jquery - how to call parent div tag but no id and class? -
i have img common class
<div debug-id="slide-0" style="width: 800px; height: 356px; top: 0px; left: -800px; position: absolute; overflow: hidden;"> <img class="commonclass" u="image" id="imgid_1" src="upload/img_1.jpg" border="0" style="width: 800px; height: 356px; top: 0px; left: 0px; position: absolute;"></div>
img class name same div debug-id different how call parent div of style left
<div debug-id="slide-1" style="width: 800px; height: 356px; top: 0px; left: 0px; position: absolute; overflow: hidden;"> <img class="commonclass" u="image" id="imgid_2" src="upload/img_2.jpg" border="0" style="width: 800px; height: 356px; top: 0px; left: 0px; position: absolute;"></div>
and more
<div debug-id="slide-2" style="width: 800px; height: 356px; top: 0px; left: 0px; position: absolute; overflow: hidden;"> <img class="commonclass" u="image" id="imgid_3" src="upload/img_2.jpg" border="0" style="width: 800px; height: 356px; top: 0px; left: 0px; position: absolute;">
if you're trying select parent div despite not having id , class selectors available, select image , use parent() below:
$('img.commonclass').parent();
Comments
Post a Comment