案例:javascript案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<body>
3
4
<form>
5
I have a bike: <input id="bike" alt="bike" type="checkbox" name="Bike" />
6
<br />
7
I have a car: <input id="car" alt="car" type="checkbox" name="Car" />
8
</form>
9
10
<p>The alt text for the checkboxes are:
11
<script type="text/javascript">
12
document.write(document.getElementById('bike').alt);
13
document.write(" and ");
14
document.write(document.getElementById('car').alt);
15
</script></p>
16
17
</body>
18
</html>
19