0
나는이 HTML {{click_event}} 내가 데이터 상태 나 데이터가 요소를 찾을 수 있습니다 때까지 재귀 적으로 검색 할 한 요소 중 하나에 클릭에가져 오기 부모가 반복적으로
<div id="main-container">
<div style="style-here" data-status="active" data-state="loaded">
<div style="style-here">
<div style="style-here" {{click_event}}></div>
</div>
</div>
<div style="style-here" data-status="active" data-state="unloaded">
<div style="style-here">
<div style="style-here" {{click_event}}></div>
</div>
</div>
<div style="style-here" data-status="inactive" data-state="unloaded">
<div style="style-here">
<div style="style-here" {{click_event}}></div>
</div>
</div>
</div>
에게 있습니다 DIV - 최악의 경우에는 이드를 만날 때부터 검색을 중지합니다.
HTML은 다른 JS 파일에서 생성되며 작성 방법을 변경할 수 없습니다. closest
또는 parent
과 jQuery
의 방법이 있습니까? data
속성을 검색하는 방법이 있습니까?
감사합니다.
내가 가장 가까운하지만'DIV로했습니다. – Nebunel