
January 13th, 2013, 02:04 PM
|
|
Contributing User
|
|
Join Date: Jun 2002
Location: Canada
Posts: 368
Time spent in forums: 20 h 54 m 21 sec
Reputation Power: 11
|
|
|
nevermind...got it
Quote: | Originally Posted by mr_fitz Bit frustrated getting my show/hide function to work
I know where the problem is - after ShowNewsComments( - but cannot seem to solve the syntax:
function ShowNewsComments(snc, comdiv, butdiv){
if (snc=="h"){
alert(comdiv);
document.getElementById(comdiv).style.display = 'none';
document.getElementById(butdiv).innerHTML = '<input class="buttoncomment rightstuff" type="submit" onclick="ShowNewsComments(\'s\',\'+comdiv+\',\'+butdiv+\')" value="Comments">';
}
if (snc=="s"){
alert(comdiv);
document.getElementById(comdiv).style.display = 'block';
document.getElementById(butdiv).innerHTML = '<input class="buttoncomment rightstuff" type="submit" onclick="ShowNewsComments(\'s\',\'+comdiv+\',\'+butdiv+\')" value="Comments">';
}
}
appreciate the help |
This works:
document.getElementById(butdiv).innerHTML = "<input class=\"buttoncomment rightstuff\" type=\"submit\" onclick=\"ShowNewsComments('s','"+comdiv+"','"+butdiv+"')\" value=\"Comments\">";
|