Show/Hide Div Help

This is a discussion on "Show/Hide Div Help" within the JavaScript Forum section. This forum, and the thread "Show/Hide Div Help are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack (1) Thread Tools
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old Feb 21st, 2006, 09:17
Up'n'Coming Member
Join Date: Feb 2004
Location: Woodbridge, UK
Age: 27
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Trebz Send a message via MSN to Trebz
Question Show/Hide Div Help

Hi
Does anyone have a bit of code I could borrow that will not just toggle a div on & off, but also the link that does the deed?
I want to be able to have something like...
Hide HelpText
blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah
blah blah blah"
And then when you click "Hide HelpText" it becomes
Show Help Text
Reply With Quote

  #2 (permalink)  
Old Feb 21st, 2006, 16:45
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
Re: Show/Hide Div Help

javascript:

Code: Select all
function change() {

if (document.getElementById("showhide").style.display == "none") {

document.getElementById("showhide").style.display = "inline";

document.getElementById("thetext").innerHTML = "Hide Help Text";

} else {

document.getElementById("showhide").style.display = "none";

document.getElementById("thetext").innerHTML = "Show Help Text";

}

}
and the HTML:

HTML: Select all
<a href="javascript:change();"><span id="thetext" style="display:inline">Show Help Text</span></a>

<div style="display:none" id="showhide">

blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah
blah blah blah

</div>
hope that helps!
Reply With Quote
  #3 (permalink)  
Old Feb 21st, 2006, 22:37
Up'n'Coming Member
Join Date: Feb 2004
Location: Woodbridge, UK
Age: 27
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Trebz Send a message via MSN to Trebz
Re: Show/Hide Div Help

Excellent!!!

Exactly what I needed

Thanks very much Ben, much appreciated :-D
Reply With Quote
Reply

Tags
showhide, div, help

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.webforumz.com/javascript-forum/5400-show-hide-div-help.htm
Posted By For Type Date
html help div This thread Refback Sep 11th, 2006 19:17

Similar Threads
Thread Thread Starter Forum Replies Last Post
Show/hide/add textfields from dropdownmenu UD2006 JavaScript Forum 0 Apr 9th, 2008 08:36
CSS Show Hide with JS abis123 JavaScript Forum 4 Dec 13th, 2007 05:39
[SOLVED] Show&amp;Hide Div Box Maska JavaScript Forum 6 Oct 1st, 2007 11:04
Show/Hide JS pa007 JavaScript Forum 0 Apr 6th, 2007 19:18
Show and Hide Text - how do I do that? Love2Java JavaScript Forum 1 Mar 29th, 2007 00:23


All times are GMT. The time now is 23:56.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43