Jump to content

Change Anchor with AJAX


justinbriggs1

Recommended Posts

Hello, I wanted to change the text inside an anchor element using AJAX. Sort of like:<a id="title1">How do I change this text?</a>Is there any way I can do:document.getElementByID(title1).value= httpObject.responseText; with value being the text? Any help would be appreciated. Thanks,JW

Link to comment
Share on other sites

The correct way to change the text inside an element would be to use the innerHTML. Example:document.getElementById("title1").innerHTML = "whatever you want here"Also, be sure to have quotes around the Id, and be sure that only the I in Id is capitalized. Javascript is case sensitive I believe.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...