我正在尝试从文件名中检查以下内容:
images/PRODUCT/icon/
从包含以下内容的页面:div.lookup-image-wrapper
如果我将它们都匹配,那么我想向包含以下内容的图像添加一个类:
images/PRODUCT/icon/
HTML:
<div class="lookup-image-wrapper" style="text-align: center">
<div id="divProductPicZ23280" style="display:none"></div>
<div class="divProductPic" id="divProductPic23280">
<img alt="Camping" border="0" id="ProductPic23280" name="ProductPic23280" src="images/Product/medium/23280.jpg">
</div>
<img alt="Show Picture 1" border="0" onclick="setcolorpicidx_23280(1);" src="http://i47.tinypic.com/o7szev.jpg" style="cursor:hand;cursor:pointer;">
<img alt="Show Picture 2" border="0" onclick="setcolorpicidx_23280(2);" src="http://i47.tinypic.com/o7szev.jpg" style="cursor:hand;cursor:pointer;">
<img alt="Show Picture 3" border="0" onclick="setcolorpicidx_23280(3);" src="http://i47.tinypic.com/o7szev.jpg" style="cursor:hand;cursor:pointer;">
<img alt="Show Picture 4" border="0" onclick="setcolorpicidx_23280(4);" src="skins/skin_1/images/nopictureicon.gif" style="cursor:hand;cursor:pointer;">
<img alt="Show Picture 5" border="0" onclick="setcolorpicidx_23280(5);" src="images/PRODUCT/icon/23280_5_.jpg" style="cursor:hand;cursor:pointer;">
jQuery:
$("img[src='images/PRODUCT/icon/']").addClass("selected highlight");