I am working on the following code.(我正在研究以下代码。)
I want to find out why I am not able to target the<img>
tag which only has the "award logos" alt
(我想找出为什么我无法定位仅包含“奖项徽标” alt
的<img>
标签的原因)
<img src="http://www.....jpg" alt="award logos">
<img src="http://www.....jpg" alt="Ranking">
<script>
$(document).ready(function() {
$('img [alt="award logos"]').wrap("<a href='http://google.com' </a>");
});
</script>
Technically, what I want to do is targeting all the images that has the specific alt attributes.(从技术上讲,我要针对具有特定alt属性的所有图像。)
ask by Mona Coder translate from so