|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
JavaScript - Function toggle
I am trying to modify this script so once the question is displayed by clicking on "Display", the word display will be changed to "Close". Can this be done?
[code] <SCRIPT LANGUAGE=vbscript> function toggle(id) if document.all ("info"&id).style.display="inline" then document.all ("info"&id).style.display="none" else document.all ("info"&id).style.display="inline" end if end function </SCRIPT> <BODY> <%id = 1%> <div id=question<%=id%> onclick="toggle(<%=id%>)" onmouseover="question<%=id%>.style.color='blue'" onmouseout="question<%=id%>.style.color='black'" style="cursor:hand"><b>Display:</B></div> <span name=info<%=id%> id=info<%=id%> style="display:none"> <TABLE name= border=1 cellPadding=1 cellSpacing=1 width=600> <tr><TD><b>A: </b>a</td></tr> <tr><TD><b>B: </b>b</td></tr> <tr><TD><b>C: </b>c</td></tr> <tr><TD><b>D: </b>d</td></tr> </TABLE> <br> </span> [code] |
|
#2
|
||||
|
||||
|
Have a look at innerHTML - this will allow you to change the contents of the DIV
__________________
selwonk |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > JavaScript - Function toggle |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|