<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<select name = "edu" id = "edu">
<option value = "博士">博士~~~</option>
<option value = "本科" id="benke">本科~~~</option>
<option value = "大专">大专~~~</option>
<option value = "幼儿园">幼儿园~~~</option>
</select>
<script>
var gra = document.getElementById("edu");
var A = gra.childNodes;
alert(A[0].nodeName);
</script>
</body>
</html>
第一个子节点的nodeName不应该是option么?还有就是,当alert(A[2].nodeValue)时,为什么不输出博士,而是空白
fantacy吴贝
stone310
其实我真的不是东北人