var code line stopping the rest code from printing hello world
hi
if i comment or remove the line
Code:
var pp = document.pform.name.value;
then the below code prints "hello world" 10 times.
but if i uncomment that line, then the code prints nothing
why is that line stopping the code from working.
no error is seen in firefox console.
vineet
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript">
var pp = document.pform.name.value;
for(i=0;i<10;i++)
{
document.write("Hello World <br>");
}
</script>
</head>
<body>
<form action="" method="post" name="pform" id="pform">
<input type="text" name="name" id="uniqueID" value=""/>
<input type="submit" value="submit" />
</form>
</body>
</html>