2

I've been trying to change the text that's within the #vehicle .partnumber section on the page from Click For More Info to Click Here For Price, preferably with a background image.

Website here.

I tried JQuery replace as well as the java-script and gotten as far as appending text before and after, also replacing the section with an image - but then the link did not work.

Any recommendations or solutions?

Thank you in advance!

4 Answers 4

1

Try

$('#vehicles .partnumber a').html('Click Here For Price');

for text replacement Try

$('#vehicles .partnumber a').html('<img src="<YOUR_IMAGE_URL>" border=0/>');

for image replacement.

Sign up to request clarification or add additional context in comments.

2 Comments

Cybernate, thank you for your response; I appended the following text: <script type="text/javascript"> $('#vehicles .partnumber a').html('Click Here For Price'); </script> No changes have taken place. Can you visit the url and see if there's anything else that is preventing the text from updating? Thank you!
You shuold call the javascript function ocne the dom s ready and the elements are created. Try this $(document).ready ( function() { $('#vehicles .partnumber a').html('Click Here For Price'); } )
0

Don't know if i understood it correctly, but this changes the link text and sets a backround image:

$('#vehicle .partnumber a).html('Click Here For Price').css('background-image','url(someimage.jpg)');

Comments

0

Try something like

$("#vehicle .partnumber").each(function(index, el)){

   // change the background of the td element
   $(el).css("background-image","url(/myimage.jpg)");

   // Remove the text from the inner anchor tag
   $(el).find("a").html("");
});

Comments

0

How about?

$('#vehicle .partnumber a).html('Click Here For Price').append('<img src="path/to/img"/>');

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.