Hi,
I know i can pass an element to a function by its id, but the id has been used for other purpose – show/hide, so i nned another element property to pass rather than id, how to do that?
thanks
i am new to javascript, following is my code, please help
<html>
<head>
<title>Welcome</title>
<style type=”text/css”>
#seenot00
{
display:none;
}
#seeyes00
{
display:yes;
}
</style>
<script LANGUAGE=”JavaScript”>
function ShowHideElement(eleMy,eleSH,bShow,strMore,strLess)
{
if(bShow)
{
eleSH.id =”seeyes00″;
eleMy.innerHTML =strLess;
}
else
{
eleSH.id =”seenotyes”;
eleMy.innerHTML =strMore;
}
}
</script>
</head>
<body>
Put some text here then click to <br>
(read <u><font color=’#000081′>
<span align=”left;” style=”cursor:pointer;”
onMouseOver=”ShowHideElement(this,goodonyou,true,’more’,’less’);”
onMouseOut=”ShowHideElement(this,goodonyou,false,’more’,’less’);”>
more
</span></font></u> …)
<div name=”goodonyouoo” id=”goodonyou”;>
<!———————————–>
<font size=”8″ color=”FF0000″>
Add your code to show/hide in this part.
</font>
<!———————————–>
</div>
</body>
</html>