Jump to content

[SOLVED] Changing a static peice of text


eddy556

Recommended Posts

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

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.