Demo of a simple spoiler script, used to automatically hide an toggle spoilers. View source to see the usage and look at spoiler.js for the source.

It's very simple to use. Just include the javascript and wrap any spoilers in a div with a class of "spoiler".

For this example, the spoiler class is giving a light border, but you can style it however you want.

This is a standard div without the "spoiler" class.

Even though this has a "spoiler" class, this is not a spoiler because it's a paragraph, not a div.

This is a basic spoiler.

You can also add more classes to give spoilers additional style:

This is another spoiler with a second class to add style.

You can even nest spoilers:

This is a nested spoiler.
This spoiler has a child spoiler.