我有以下HTML:jQuery的 - addClass不工作
<div class="b-250">
<div id="c6281_701_1" class="sam-container sam-place" data-sam="1">
<a id="a55_701" class="sam_ad" target="_blank" href="XYZ">
<img alt="" src="XYZ">
</a>
</div>
</div>
<script>
jQuery(document).ready(function(){
console.log('try it - window ready');
//jQuery('div.sam_ad').find('img').addClass('wp-post-image article- thumbnail');
console.log(jQuery(".b-250").find('div'));
jQuery(".b-250").find('div').addClass("home-post has-post-thumbnail post");
console.log('did it - window ready');
});
</script>
我不能设法几类添加到元素与sam_ad
类。我试过jQuery('.sam_ad')...
或以上的不同方法。
任何线索?
感谢