Next Gen Boards
 

Sponsored Links
Arcade YouTube vbBux / vbPlaza Calendar FAQ

Reply
 
Thread Tools Display Modes  
Subless
Gunnery Sergeant Grade 2
 
Subless's Avatar
 
Join Date: Sep 2007
Location: In a house
Posts: 136
Rep Power: 2 Subless is on a distinguished road Reputation: 10
Points: 55,796.74
Bank: 3,031.17
Total Points: 58,827.91
Subless is offline
 
Send a message via AIM to SublessSend a message via Yahoo to Subless
 
#1
01-25-2008, 12:03 AM   #1
Reply With Quote
Question Weird JavaScript Problem

I can't seem to get my JavaScript to fully work. The first if statement works fine but the second part will not execute when I click the button again. To understand my problem just copy my code and save it as a .html or .htm file and test it yourself to see if you can fix it for me and then repost the working code. Thanks,

Code:
<html>
<head>
<script type="text/javascript">
function extra()
{

if (document.getElementById('button').value="Show Message")
{
document.getElementById('msg').style.display="block";
document.getElementById('button').value="Hide Message";
}

else if (document.getElementById('button').value="Hide Message")
{
document.getElementById('msg').style.display="none";
document.getElementById('button').value="Show Message";
}
}
</script>
<style type="text/css">

#msg{display:none;}

</style>
</head>
<body>

<input type="submit" value="Show Message" id="button" onClick="extra();"/> <br/><br/>

<div id="msg">Hey this is a message.</div>

</body>
</html>
__________________
Domain Names For Sale !!!
Code Exploit.com
Free Mix.info
BBWT.org
If you are interested click the link to make an offer.
Report Post
mameman2
Commander Grade 4
 
mameman2's Avatar
 
Join Date: Mar 2007
Location: in the shoutbox mostlikely
Posts: 554
Rep Power: 2 mameman2 is on a distinguished road Reputation: 17
Points: 301.00
Bank: 405,084.79
Total Points: 405,385.79
for giving me 60 bucks - cobrad for getting hacked - RezSide 
Boston Red Sox New England Patriots
mameman2 is offline
 
Send a message via AIM to mameman2Send a message via Yahoo to mameman2
 
#2
01-25-2008, 04:28 PM   #2
Reply With Quote
lol srry i dont speak java i only know like 1 thing....ask bravo or GLoRY GuNz
__________________
DONT CLICK HERE

Quote:
[Today 08:54 PM] conrad127:we just abuse our powers and ban people
Quote:
[Today 09:04 PM] Tinsley85: no i'm a noob!!!
Quote:
[Today 10:22 PM] heavytech94: attack and brutally murder mamemam
Report Post
Reply

Bookmarks

Thread Tools
Display Modes

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 Off
Pingbacks are Off
Refbacks are Off
Forum Jump

top Go to Top All times are GMT -4. The time now is 04:20 PM.

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 Copyright ©2006 - 2008, NextGenBoards. All Rights Reserved