Tuesday, 27 August 2013

Parent of an id using Jquery

Parent of an id using Jquery

<div class="cdlButton" style="width:40px; float: left;"> // want this div
element
<div style="">
<a id="changestatus" class="" onclick="changeWorkflowStatus()"
href="#">
<img id="" width="32px" height="32px" title="disable"
alt="disable" src="images/disable.png">
</a>
</div>
</div>
I want div with help of jquery Right now i am doing this way
$("#changestatus ").parent().parent().addClass('disablecdlButton');
Is there any other way to get top div element

No comments:

Post a Comment