我想向img标签添加一些自定义类,并在每个img标签之后添加一个span标签,所以请让我知道可以在哪个文件中找到商店页面img标签。
有关更多详细信息,请在商店页面中查看以下标签:
<img width="300" height="222" src="http://testxone.com/tank-sanitizer/wp-content/uploads/2020/06/hand-sanitizer-300x222.jpg" class="attachment-woocommerce_thumbnail size-woocommerce_thumbnail" alt="">
查看屏幕快照以获取更多详细信息:
谢谢。
答案 0 :(得分:1)
尝试将其添加到img标签中,并根据需要添加跨度。
将类别添加到img标签
$('.attachment-woocommerce_thumbnail').addClass('custom-class')
为您的img标签添加跨度
$('.attachment-woocommerce_thumbnail').append('<span class="my_span">My Custom Span</span>')
希望这会有所帮助。