Click here to Skip to main content
15,914,488 members
Home / Discussions / JavaScript
   

JavaScript

 
Questionget input text value on text change Pin
Shantanu Gupta 13378-Aug-10 4:02
Shantanu Gupta 13378-Aug-10 4:02 
AnswerRe: get input text value on text change Pin
Sandeep Mewara8-Aug-10 4:47
mveSandeep Mewara8-Aug-10 4:47 
GeneralRe: get input text value on text change Pin
Shantanu Gupta 13378-Aug-10 6:11
Shantanu Gupta 13378-Aug-10 6:11 
GeneralRe: get input text value on text change Pin
Sandeep Mewara8-Aug-10 6:29
mveSandeep Mewara8-Aug-10 6:29 
GeneralRe: get input text value on text change [modified] Pin
Shantanu Gupta 13378-Aug-10 7:03
Shantanu Gupta 13378-Aug-10 7:03 
GeneralRe: get input text value on text change Pin
Not Active8-Aug-10 7:35
mentorNot Active8-Aug-10 7:35 
QuestionAdobe plug-in IE browser Pin
nlarson116-Aug-10 8:45
nlarson116-Aug-10 8:45 
QuestionShow and hide DIV tag Pin
Dave McCool5-Aug-10 13:15
Dave McCool5-Aug-10 13:15 
Hi,

I have a DIV tag that I want to hide the content when the webpage loads and you can click a link to show the content in the tag or hide it. What I am wanting to do is have one link that says "show" before you click it and when you click it, shows the content of the DIV and the text changes to "hide" and when you click "hide" the DIV content hides and the text reverts to saying "show" and when you click it, it shows the DIV content and so on.

Code in header:

<script language=javascript type='text/javascript'> 
function hideDiv() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow').style.visibility = 'hidden'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow.visibility = 'hidden'; 
} 
else { // IE 4 
document.all.hideshow.style.visibility = 'hidden'; 
} 
} 
} 

function showDiv() { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById('hideshow').style.visibility = 'visible'; 
} 
else { 
if (document.layers) { // Netscape 4 
document.hideshow.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow.style.visibility = 'visible'; 
} 
} 
} 
</script>


the DIV tag where the content is placed in is this:

<div id="hideshow" class="style111">;

Content here

</div>


I have this code to show and hide the div tag:
<a onclick="javascript:showDiv()"</a class="style110"> show</a><a onclick="javascript:hideDiv()" class="style110">hide</a>


Is there a way of using one link to show and hide the div tag rather than two seperate links? And is there a way of automatically hide the content when the page loads so you have to click "show" to show the content?

Thanks in advance
In the end we're all just the same

AnswerRe: Show and hide DIV tag Pin
Not Active5-Aug-10 15:18
mentorNot Active5-Aug-10 15:18 
AnswerRe: Show and hide DIV tag Pin
NeverHeardOfMe5-Aug-10 21:56
NeverHeardOfMe5-Aug-10 21:56 
AnswerRe: Show and hide DIV tag Pin
koolprasad20039-Aug-10 21:18
professionalkoolprasad20039-Aug-10 21:18 
Questionsend email with no further parameters Pin
Hemant Thaker5-Aug-10 0:49
Hemant Thaker5-Aug-10 0:49 
AnswerRe: send email with no further parameters Pin
Sandeep Mewara8-Aug-10 3:21
mveSandeep Mewara8-Aug-10 3:21 
QuestionHow to close all pop-up on click on logout Pin
InderK4-Aug-10 8:01
InderK4-Aug-10 8:01 
AnswerRe: How to close all pop-up on click on logout Pin
Not Active4-Aug-10 8:45
mentorNot Active4-Aug-10 8:45 
GeneralRe: How to close all pop-up on click on logout Pin
InderK4-Aug-10 18:07
InderK4-Aug-10 18:07 
GeneralRe: How to close all pop-up on click on logout Pin
Not Active5-Aug-10 2:21
mentorNot Active5-Aug-10 2:21 
GeneralRe: How to close all pop-up on click on logout Pin
InderK5-Aug-10 2:37
InderK5-Aug-10 2:37 
AnswerRe: How to close all pop-up on click on logout Pin
Prosanta Kundu online4-Aug-10 19:58
Prosanta Kundu online4-Aug-10 19:58 
QuestionHelp : Dynamically maintaining left position Pin
Chakouri3-Aug-10 20:11
Chakouri3-Aug-10 20:11 
AnswerRe: Help : Dynamically maintaining left position Pin
Prosanta Kundu online4-Aug-10 19:55
Prosanta Kundu online4-Aug-10 19:55 
QuestionCheck file in JavaScript Pin
ShafiqA2-Aug-10 22:54
ShafiqA2-Aug-10 22:54 
AnswerRe: Check file in JavaScript Pin
koolprasad20033-Aug-10 4:05
professionalkoolprasad20033-Aug-10 4:05 
GeneralRe: Check file in JavaScript Pin
ShafiqA3-Aug-10 18:10
ShafiqA3-Aug-10 18:10 
AnswerRe: Check file in JavaScript Pin
Yusuf4-Aug-10 5:35
Yusuf4-Aug-10 5:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.