How To Put Spoiler Button In Blogger

Spoiler Button In Blogger Templates by Templateify

The spoiler has the function to hide and show text or images, and is very useful when trying to reduce space in the inputs or only if you want the text or image only see when pressed.

The first thing you need is the code:

<div><input value="Show" onclick="if(this.parentNode.getElementsByTagName('div')[0].style.display != ''){this.parentNode.getElementsByTagName('div')[0].style.display = '';this.value = 'Hide Content';}else{this.parentNode.getElementsByTagName('div')[0].style.display = 'none'; this.value = 'Show Content';}" type="button" />
<div style="display: none;">HIDE CONTENT GOES HERE</div></div>

The red text you can modify the text, link or whatever you want to put.

Copy the code and paste in the new entry in Edit HTML in place of the entry where you want to show.

Modify the text to display when pressed and ready.

This would be the result, press and testing.

Thanks For Visiting
1 Star2 Stars3 Stars4 Stars5 Stars
(4 votes, average: 5.00 out of 5)

Leave a Reply

Your email address will not be published. Required fields are marked *