요즘 내가 읽고 내 문제에 대한 자세한 내용은 코드가 여기에 있습니다 :!자바 스크립트 + 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 자식 DIV에서의 버튼 fired.When을 + 얻을 수있는 방법이다 이 버튼은 사람이 ThiefMaster가 지적한 바와 같이, 'parent.childNodes[count]'
이 parent.childNodes[count]
을해야
<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 [카운트]) '이어야한다'경고 (parent.childNodes [카운트]); ' – ThiefMaster