The code displays hello as soon as the user clicks on the button but the text dissappears as soon as the click button is released. Why is it not static ? Is it because of the onClick event???Here's the code
<HTML>
<HEAD>
<TITLE>Select Sample Example</TITLE>
<SCRIPT type="text/javaScript">
function test()
{
var textblock=document.createElement("p");
var txt = document.createTextNode("hello");
textblock.appendChild(txt);
document.getElementById("myform").appendChild(txt);
}
</SCRIPT>
</HEAD>
<BODY>
<FORM id="myform" method="get" action="">
<INPUT type="submit" name="Pavement_Submit" value="click" style="position:absolute;left:449px;top:200px;z-index:76" onClick=test()>
</FORM>
</BODY>
</HTML>
Can anyone please suggest what may be wrong?
Thanks