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 Link to comment https://forums.phpfreaks.com/topic/108962-solved-changing-a-static-peice-of-text/ 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; Link to comment https://forums.phpfreaks.com/topic/108962-solved-changing-a-static-peice-of-text/#findComment-561810 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 Link to comment https://forums.phpfreaks.com/topic/108962-solved-changing-a-static-peice-of-text/#findComment-565052 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.