!! We are offering existing members a one-time change in their usernames as a result of the site's adjustments. Please contact imToph for details. !!
!! Moderator and Graphic Designer Recruitment @ Announcements Board. !!

You are not connected. Please login or register

View previous topic View next topic Go down Message [Page 1 of 1]

1JavaScript Show/Hide Code on Sat Jul 09, 2011 2:07 am


imToph

avatar
Administrator

View Extended User Information
TUTORIAL: Show/Hide Code
If you want to have a show and hide button or text on an HTML page, follow this simple steps.

Add this code to an HTML page.
Code:
<a onclick="javascript:ShowHide('HiddenDiv_###')" href="javascript:;" >TRIGGER TITLE</a>
<div id="HiddenDiv_###" style="DISPLAY: none" >SHOWN WHEN THE TRIGGER HAS BEEN CLICKED</div>

<script language="JavaScript">function ShowHide(divId){if(document.getElementById(divId).style.display == 'none'){document.getElementById(divId).style.display='block';}else{document.getElementById(divId).style.display = 'none';}}</script>

Note: ### should be the same number for this code to work.

Demo: The Frequently Asked Questions
http://one2studios.forum.st

View previous topic View next topic Back to top Message [Page 1 of 1]

Permissions in this forum: You cannot reply to topics in this forum




One2 Studios © 2011-2012
Designed and maintained by One2 studios.
Hosted by Forumotion | PunBB © | Report an Abuse



Free forum | © PunBB | Free forum support | Contact | Report an abuse | Free forum