<div class='pagename lock' style='float:left;width:200px;'>
<a href='javascript:void(0);' class='pages' title='Click to Go' rel="id" >
</div>
$(".pages a[rel=id]").parent().addClass("unlock")
The Unlock class is not adding in parent div, why?
Your first selector is incorrect. It looks for anchors within elements with class
.pages. Try: