0
我建立一個Chrome擴展和我的代碼是這樣一個塊:。經過()不工作按預期
$('a').filter(function() {
return $(this).html().match(/myexpressionhere/);
}).after().append('<img src="myImage" />');
當我運行代碼,它增加了我的形象給每個錨鏈接爲它應該。然而,它增加了他們裏面象鏈接:
<a ...> yada yada <img src="myImage" /></a>
,而不是之後,就像我想:
<a ...> yada yada</a><img src="myImage" />
任何想法,爲什麼?
使用insertAfter() – Hushme