我有以下的HTML块:
<div class="product BLACKSHIRT">
<span class="displayPrice">£50</span>
</div>
<div class="product WHITESHIRT">
<span class="displayPrice">£40</span>
</div>
<div class="product GREENSHIRT">
<span class="displayPrice">£55</span>
</div>
<div class="product YELLOWSHIRT">
<span class="displayPrice">£50</span>
</div>
<div class="product BLACKJACKET">
<span class="displayPrice">£60</span>
</div>
<div class="product WHITESHORTS">
<span class="displayPrice">£20</span>
</div>
<div class="product BLACKTROUSERS">
<span class="displayPrice">£30</span>
</div>
我想做的是挑选出每个div的类名中有“SHIRT”或“JACKET”的一部分,然后勾出内部span的值-并将当前值加15,例如
<div class="product BLACKSHIRT">
<span class="displayPrice">£50</span>
</div>
成为
<div class="product BLACKSHIRT">
<span class="displayPrice">£65</span>
</div>
这可能吗?我对现有的html没有任何控制,并且知道需要剥离“£”以使值变为数字。
1条答案
按热度按时间jk9hmnmh1#
使用Attribute Contains Selector
*=
。