아래 코드와 관련하여 동적으로 생성 된 ID가있는 div의 'role'속성을 가져와야합니다.동적 ID로 클릭 한 div의 속성 가져 오기
HTML :
<div id="renable0" role="0">
false
</div>
<div id="renable1" role="1">
true
</div>
<!-- THE LIST OF DIVS CONTINUES IN INCREASING INCREMENTS OF 1 -->
자바 스크립트 :
$("[id^='renable']").editInPlace({ // editInPlace is a jQuery plugin
url: 'save.php',
params: 'pos='+$(this).attr('role') // How can I get this role attribute for the clicked div?
});