Skip to content
WJunction - Webmaster Forum

Onclick, display hidden script

Status
Not open for further replies.
ok guyz, so i need a script that you need to click a button, lets say a "yes" button and then to see the original content hidden by me. need this for a phpbb bbcode. someone can help ?
 

1 comment

Here you go

PHP:
<div style="margin:20px; margin-top:5px">
	<div style="font: 11px Verdana, Geneva, Lucida, 'Lucida Grande'; margin-bottom:2px" >
		<input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }" /></div><div style="min-height: 20px; background-color: #EDE8E0; margin: 0px; padding: 6px; border: 1px inset;"><div style="display: none;">Hide me. Text.</div></div></div>
 
Last edited:
Status
Not open for further replies.

About the author

A
Active Member · Joined
72
Messages
1
Reactions
8
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom