HTML:
<div class="a" style="width:auto;...."> //I wanna add some inline-style to overwrite some stylesheet here.
<div class="a">child</div>
<div class="a">child</div>
</div>
<div class="a">
<div class="a">child</div>
<div class="a">child</div>
</div>
正如你在上面看到的,我想抓住与子div具有相同className的父div,我该怎么做?
这是我的代码:
var get_div_a = $('div.a');
var len = get_div_a.size();
var arr = [];
for(var i = 0; i < len ; i++){
if($(get_div_a[i]).children('div.a')!==0){
...no idea ???
}
}