0

I currently have this code for an online store shopping cart:

<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>

What I need to do is replace the "Remove" text with an image, so the user can click on the image to remove an item from the shopping cart.

How can I do this without affecting the function of the rest of the link?

I've tried first selecting the content with this:

$(".ShoppingList_RemoveCheckBox").filter(function(){
return $(this).html() == "a";

To select the code, but then I'm not sure if there's a way to change the text ONLY. I know there's the .text() Jquery, but don't you have to have a specific id to reference for that?

0

2 Answers 2

1
$('.ShoppingList_RemoveCheckBox a').html('<img src="remove.gif" />')
Sign up to request clarification or add additional context in comments.

Comments

1
$("span.ShoppingList_RemoveCheckBox a:contains(Remove)").html($("<img/>", { src: imageURL }));

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.