Jquery替换<;span>;带图像的文本
我目前拥有在线商店购物车的以下代码:Jquery替换<;span>;带图像的文本,jquery,Jquery,我目前拥有在线商店购物车的以下代码: <span class="ShoppingList_RemoveCheckBox"> <a onclick="document.My_Account_Shopping_List_Detail_Content.rcuid.value="475"; document.My_Account_Shopping_List_Detail_Content.FormSubmittedByLink.value="submittedByRemoveLink";
<span class="ShoppingList_RemoveCheckBox">
<a onclick="document.My_Account_Shopping_List_Detail_Content.rcuid.value="475";
document.My_Account_Shopping_List_Detail_Content.FormSubmittedByLink.value="submittedByRemoveLink"; document.My_Account_Shopping_List_Detail_Content.submit(); return false;" href="noURL">Remove </a>
</span>
选择代码,但我不确定是否有办法只更改文本。我知道有.text()Jquery,但是你不需要有一个特定的id来引用它吗?$(“span.ShoppingList\u RemoveCheckBox a:contains(Remove)”).html($(“$('.ShoppingList\u RemoveCheckBox a').html(“”)
$("span.ShoppingList_RemoveCheckBox a:contains(Remove)").html($("<img/>", { src: imageURL }));
$("span.ShoppingList_RemoveCheckBox a:contains(Remove)").html($("<img/>", { src: imageURL }));
$('.ShoppingList_RemoveCheckBox a').html('<img src="remove.gif" />')