Forum Moderators: open

Message Too Old, No Replies

Changing a <p> tags text

I need help with changing the text in a <p> tag

         

CoolJRT2009

1:17 am on Jan 2, 2009 (gmt 0)

10+ Year Member



If I had the code:

<input type="text" name="texttochangeto">
<input type="button" onclick="texttochange.?WHAT?=texttochangeto.value" value="Change">
<br>
<p (NAME OR ID?)="texttochange">
This is the text you will change.
</p>

What would I need to change to make it work?
Where ?WHAT? is, what do I need to put?
Where (NAME OR ID) is, do I put name or id?

two4god07

3:38 am on Jan 2, 2009 (gmt 0)

10+ Year Member



i can answer one question... ID is what you use to lable something that will be used in script.. and NAME is not xhtml compliant.

Some webpage developers suggest using both.

name="texttochange" id="texttochange"

they won't interfere with each other, and it won't hurt older browsers