我有以下 HTML:-
<li class="rpItem rpFirst d1">
<a href="#" class="rpLink 1">
<span class="rpOut"><img alt="" src="http://localhost:64034/Images/favorites_small.png" class="rpImage">
<span class="rpExpandHandle"></span>
<span class="rpText">Product1</span>
</span>
</a>
</li>
<li class="rpItem">
<a href="#" class="rpLink 2">
<span class="rpOut"><img alt="" src="Images/transparent.png" class="rpImage">
<span class="rpExpandHandle"></span>
<span class="rpText">Product2</span>
</span>
</a>
</li>
<li class="rpItem">
<a href="#" class="rpLink 3">
<span class="rpOut"><img alt="" src="Images/transparent.png" class="rpImage">
<span class="rpExpandHandle"></span>
<span class="rpText">Product3</span>
</span>
</a>
</li>
<li class="rpItem d1">
<a href="#" class="rpLink 4">
<span class="rpOut"><img alt="" src="Images/transparent.png" class="rpImage">
<span class="rpExpandHandle"></span>
<span class="rpText">Product4</span>
</span>
</a>
</li>
<li class="rpItem d1">
<a href="#" class="rpLink 5">
<span class="rpOut"><img alt="" src="Images/transparent.png" class="rpImage">
<span class="rpExpandHandle"></span>
<span class="rpText">Product5</span>
</span>
</a>
</li>
<li class="rpItem d1">
<a href="#" class="rpLink 6">
<span class="rpOut"><img alt="" src="Images/transparent.png" class="rpImage">
<span class="rpExpandHandle"></span>
<span class="rpText">Product6</span>
</span>
</a>
</li>
我希望针对第一个 li,它具有src="http://localhost:64034/Images/favorites_small.png"
.
所以我想做类似的事情
if (imagename = favorites_small.png)
然后从该项中移除点击事件,即不允许点击。
我怎样才能做到这一点?