PDA

View Full Version : Advanced spoiler hidingt


EvanAbagail
02-10-2015, 07:47 PM
Hello.

I have a spoiler BBCode at the moment but it only shows and hides. Basically, I want it to when pressed show the content(like it does), but then change the button text to "Hide Spoiler" and when clicked when showing hide the content again. Thank you,


<div class="spoiler"><input type="button" class="button" onClick="this.nextSibling.nextSibling.style.display='block' ;this.parentNode.removeChild(this);" value="Show spoiler"> <span class="content" style="display:none">Bob is ugly.</span> </div>

Is my current code.

Fields
02-11-2015, 08:20 AM
Try this one:

https://vborg.vbsupport.ru/showthread.php?t=264913