hall
Mar 1st, 2001, 05:58 AM
<!--
Help!! See below. I am trying to pass a variable (option) to a function, which in this case is the id of a paragraph (i.e., "test_paragraph"). I'd like for the function then to turn off the display of the test_paragraph based on the passed variable (option). The id gets passed Ok as witnessed by the alert message. However, it will not work using the option.style.display="none"; whereas it will work if you type the actual name of the paragraph as shown in command that is not commented out (test_paragraph.style.display="none";). Is this a syntax problem? Since I'm not a javascript person, a potentially small syntax problem shuts me down. Thanks very much in advance.
KBH
-->
<SCRIPT>
function turn_paragraph_off(option)
{
alert(option)
test_paragraph.style.display="none";
// option.style.display="none";
}
</SCRIPT>
<%variable="test_paragraph"%>
<P onmouseover="turn_paragraph_off('<%=variable%>')" >
Move the mouse over this sentence make the test paragraph below turn off.
</p>
<br>
<br>
<br>
<p id=test_paragraph >
TEST TEST TEST TEST TEST TEST TEST TEST TEST
<br>
TEST TEST TEST TEST TEST TEST TEST TEST TEST
<br>
TEST TEST TEST TEST TEST TEST TEST TEST TEST
<br>
TEST TEST TEST TEST TEST TEST TEST TEST TEST
<br>
TEST TEST TEST TEST TEST TEST TEST TEST TEST
</p>
Help!! See below. I am trying to pass a variable (option) to a function, which in this case is the id of a paragraph (i.e., "test_paragraph"). I'd like for the function then to turn off the display of the test_paragraph based on the passed variable (option). The id gets passed Ok as witnessed by the alert message. However, it will not work using the option.style.display="none"; whereas it will work if you type the actual name of the paragraph as shown in command that is not commented out (test_paragraph.style.display="none";). Is this a syntax problem? Since I'm not a javascript person, a potentially small syntax problem shuts me down. Thanks very much in advance.
KBH
-->
<SCRIPT>
function turn_paragraph_off(option)
{
alert(option)
test_paragraph.style.display="none";
// option.style.display="none";
}
</SCRIPT>
<%variable="test_paragraph"%>
<P onmouseover="turn_paragraph_off('<%=variable%>')" >
Move the mouse over this sentence make the test paragraph below turn off.
</p>
<br>
<br>
<br>
<p id=test_paragraph >
TEST TEST TEST TEST TEST TEST TEST TEST TEST
<br>
TEST TEST TEST TEST TEST TEST TEST TEST TEST
<br>
TEST TEST TEST TEST TEST TEST TEST TEST TEST
<br>
TEST TEST TEST TEST TEST TEST TEST TEST TEST
<br>
TEST TEST TEST TEST TEST TEST TEST TEST TEST
</p>