x
 
<html>
<body>
<form id="myForm">
Text: <input type="text" size="20" value="Hello World" />
</form>
<script type="text/javascript">
x=document.getElementsByTagName('form')[0];
document.write("Form id: " + x.id);
document.write("<br />");
document.write("An alternate way: ");
document.write(document.getElementById('myForm').id);
</script>
</body>
</html>