這些天我已閱讀並瞭解更多關於我的問題的代碼是在這裏:的javascript + div標籤
<div align="right" id="parent" name="parent">
<select name="select30" id="select30" value=""/>here inside i have options values and work dynamically with query to my DB</select>
<input type="button" id="moreFields" value="+" onclick=""/> //add select tags
<input type="button" value="-" onclick="" /> //remove select tags
<div name="child" id="writeclone"></div> //here cloned the child from parent DIV
</div>
<input type="button" name="enter" id="" value="ENTER" onclick="getoptionvalues();"/>
我的問題是我怎麼能得到的名稱或ID +按鈕fired.When當從孩子DIV的此按鈕激發兒童DIV創建子的DIV!有人可以幫我改正我的JavaScript代碼
<script>
function getoptionvalues() {
var parent=document.getElementById('parent');
for (var count=0;count<parent.childNodes.length;count++) {
if(parent.childNodes[count].tagName =='DIV') {
alert ('parent.childNodes[count]');
}
}
}
</script>
'警報( 'parent.childNodes [COUNT]');'應'警報(parent.childNodes [COUNT] );' – ThiefMaster 2011-05-06 13:28:07