這裡的this.parentNode和this.parentNode.nextSibling指什麼?
<HTML>
<HEAD>
<META http-equiv= 'Content-Type ' content= 'text/html; charset=gb2312 '>
<TITLE> 可输入的下拉框 </TITLE>
</HEAD>
<BODY >
<div style= "position:relative; ">
<span style= "margin-left:100px;width:18px;overflow:hidden; ">
<select style= "width:118px;margin-left:-100px " onchange= "this.parentNode.nextSibling.value=this.value ">
//這裡的this.parentNode和this.parentNode.nextSibling指什麼?
<option value= "www.souzz.net "> souzz </option>
<option value= "www.eWebSoft.com "> eWebSoft </option>
<option value= "WEB开发者 "> WEB开发者 </option>
</select> </span> <input name= "box " style= "width:100px;position:absolute;left:0px; ">
</div>
</BODY> </HTML>
------解决方案--------------------span和input
------解决方案--------------------this.parentNode.nextSibling
this : <select>
this.parentNode : <select> 的父节点即 <span>
this.parentNode.nextSibling: <select> 的父节点即 <span> 的兄弟节点 <INPUT>
------解决方案--------------------alert(this.parentNode.tagName)
alert(this.parentNode.nextSibling.tagName)