我有一个小问题:
<div class="items-row cols-1 row-2">
<div class="item column-1">
<h2>
<a href="/ak/index.php/archwriting/8-2013-02-23-17-31-29">lorem ipsum dolor sit amet</a>
</h2>
<dl class="article-info">
<dt class="article-info-term"></dt>
<dd class="published">23/02/13</dd>
</dl>
<p>lorem ipsum</p>
<div class="item-separator"></div>
</div>
<span class="row-separator"></span>
</div>
我希望能够检查字符串“archwriting”是否在href
属性内,如果是,则在标签<img>
上方添加一个。<h2>
我从以下内容开始:
$('.item h2 a[href*="archwriting"]').prev().prependTo()
正确的方法是什么?