我想一个div内完成每个超链接的图像的东西带班的sampleclass
:jQuery-获取所有超链接的图像
<div class="sampleclass">
<a href="#">text hyperlink</a> <!-- don't touch this -->
<a href="#"><img src="image.jpg"></a> <!-- only touch this -->
</div>
以下是我有:
$('.sampleclass a > img').(function() {
$(this).addClass("someotherclass");
});
这没有按” t似乎工作。有什么建议么?
以何种方式是不是这方面的工作? –
事件丢失.. – John
你想添加类锚或图像 –