Make Button Hide and Show (Spoilers)

Maybe you want to hide some article or picture by using the hide / show ...? In order article looks not too much / long you can use a script spoiler. Want to know how ......?

# Copy the script below your posts:

<div>

<input value="Show" style="margin: 0px; padding:0px;width:auto;font-size:10px;" onclick="if(this.parentNode.parentNode.getElementsByTagName(&#39;div&#39;)[1].getElementsByTagName(&#39;div&#39;)[0].style.display != &#39;&#39;) { this.parentNode.parentNode.getElementsByTagName(&#39;div&#39;)[1].getElementsByTagName(&#39;div&#39;)[0].style.display = &#39;&#39;; this.innerText = &#39;&#39;; this.value = &#39;Hide&#39;; } else{ this.parentNode.parentNode.getElementsByTagName(&#39;div&#39;)[1].getElementsByTagName(&#39;div&#39;)[0].style.display = &#39;none&#39;; this.innerText = &#39;&#39;; this.value = &#39;Show&#39;; }" type="button" /></div>
<div class="alt2">
<div style="display: none;">
<div style="background:#000000;text-align:left;padding:10px;color:#ffffff;">
insert text or images here
</div>
</div>
</div>

# Replace the words "insert text or images here" with text or images that would be hidden. Note the text in red and blue if you want to edit it.

0 comments:

Post a Comment