jef_abraham
06-29-2006, 04:09 AM
<html>
<head>
<script langu…..>
function validate()
{
document.getElementById(“h1”).innerHTML=”This is H1”;
}
</script>
</head>
<body>
<h1 id=”h1”>
<form>
<input type=”button” onClick=”validate()”>
</form>
</body>
</html>
The above code has a problem…
If we run this code then "This is H1" is displayed and disappears later…if we remove the form tag it works fine and in h1 “This is H1” is displayed…..or else if w put the button element out of the form tag even that works fine
...Can any one tell me the reason for this .....
<head>
<script langu…..>
function validate()
{
document.getElementById(“h1”).innerHTML=”This is H1”;
}
</script>
</head>
<body>
<h1 id=”h1”>
<form>
<input type=”button” onClick=”validate()”>
</form>
</body>
</html>
The above code has a problem…
If we run this code then "This is H1" is displayed and disappears later…if we remove the form tag it works fine and in h1 “This is H1” is displayed…..or else if w put the button element out of the form tag even that works fine
...Can any one tell me the reason for this .....