justinbriggs1 Posted November 29, 2008 Share Posted November 29, 2008 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 More sharing options...
Sansespere Posted November 29, 2008 Share Posted November 29, 2008 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.