javascript当中getElementsByTagName的用法
例 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(){undefined
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