Hi there maheshexp,
it works without error for me. 
You might like to try using the DOM instead...
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
window.onload=function() {
frm=document.createElement('form');
frm.setAttribute('id','x');
inp=document.createElement('input');
inp.setAttribute('value','maheshexp');
frm.appendChild(inp);
document.getElementById("a").appendChild(frm);
alert('form id="'+document.forms[0].id+'"');
alert('type="'+document.forms[0][0].type+'"');
alert('value="'+document.forms[0][0].value+'"')
}
</script>
</head>
<body>
<div id="a"></div>
</body>
</html>
coothead
Bookmarks