例 6.3:getElementsByTagName()IEFF.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<SCRIPT LANGUAGE="JavaScript">
<!--
window.οnlοad=function(){
var arr = document.getElementsByTagName("option");
alert("arr[i].value is "+arr[2].value);
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<SELECT NAME="" id="province" style="width:140px;background-color:red">
<option>红</option>
<option>兰</option>
<option>紫</option>
</SELECT>
</BODY>
</HTML>
更多请见:https://blog.csdn.net/qq_43650923/article/details/102454433