Spoilers help in hiding and displaying content according to the users need. Spoilers are also used to save space in your web page.You can easily write FAQ and terms conditions in a very small space with spoilers. Today in this post we will tell about how to make spoilers without using id attribute. After reading this article, you will be able to make more than one spoilers without using the ‘id’ attributes.
What is spoilers and what is it used for ?
With the help of spoilers, you can create content of display and height type. And using spoilers you can also create a quiz in which you can hide the answer by default and when the user wants to see the answer, they can see the answer in just one click.
Spoiler HTML
<divclass="spoiler"><divclass="spoiler-toggle">
spoiler heading
</div><divclass="spoiler-content">
your hidden content
</div></div>
How to add a spoiler without using short-code based plugin in WordPress
If you are using WordPress CMS, then you can create more than one spoiler without any short code.
Step (1) :- You can use the Spoiler HTML code as many times as you want.
<divclass="spoiler"><divclass="spoiler-toggle">
spoiler heading
</div><divclass="spoiler-content">
your hidden content
</div></div>
Step (2) :- Apply Spoiler Script before </body> tag of the page. you can do this by directly applying in your theme or if you just need Spoiler in your few post you can also apply the Spoiler Script in post.