0
바인딩 용 Knockout js를 사용하고 있습니다. 자식 요소 ID를 가져 오려고합니다. 확인란을 선택하면 고유 ID로 고유 ID가 생성됩니다.확인란을 선택한 특정 하위 요소 ID 가져 오기
//this div is inside the for each loop
<div data-bind="attr: { id: 'unique_' + $index()},fav: ({item:someItem})" class="Tab">
// i need to get this itemIDs when i selecte the check box
<div id=randon_item1><div>
<div id=random_item2><div>
<div id=random_item3><div>
<div id=random_item4><div>
</div>
<input id="ckh1" type="checkbox" data-bind="value:userId(), click: $root.toggleAssociation" />
//toggleAssociation//
self.toggleAssociation = function (item, event) {
here i am getting the item and all parent div with unique_0 ID which will be incremented for others div
how i can get child element ID which is generated randomly
}
예, 그 수정 , 나는 모든 것을 다시 쓰고 그것들을 놓쳤습니다. 감사. – LegenJerry
@ 시간 주셔서 감사합니다],이게 내 문제를 해결했습니다. – Nikil