案例:javascript案例     状态:可编辑再运行    进入横版
x
 
1
<html>
2
<body>
3
4
<form id="form1">
5
<input type="password" id="password1" />
6
</form>
7
8
<p>The id of the form containing the password field is:
9
<script type="text/javascript">
10
x=document.getElementById('password1');
11
document.write(x.form.id);
12
</script></p>
13
14
</body>
15
</html>
16

 运行结果 
 北美留学生论坛