eddy556 Posted June 6, 2008 Share Posted June 6, 2008 I have an Ajax script which changes the the text in a text area box and it works perfectly. In order to do this is use the following line: document.getElementById('outputText').value = httpObject.responseText; I would also like to change a piece of text (not within a text area) in the same way. How would I do this. I have tried using my initiative and doing something like: <p id="text">This is the text to be changed</p> Where I am using the id attribute of P in order to access it by the javascript above (getElementById('text') but this does not work. Many thanks Quote Link to comment Share on other sites More sharing options...
irvieto Posted June 10, 2008 Share Posted June 10, 2008 following your example... document.getElementById('text').innerHTML = httpObject.responseText; Quote Link to comment Share on other sites More sharing options...
eddy556 Posted June 13, 2008 Author Share Posted June 13, 2008 Thank you! Exactly what I was looking for Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.