PDA

View Full Version : Display text with...



pitchoo
06-25-2002, 09:45 AM
Which HTML tag should I use if I want to display text? But I also want to access this text dynamically by the "value" attribute and display it as readonly ? (like an input tag but without the frame around the text)

Thanks!

Zvona
06-25-2002, 10:43 AM
<textarea readonly="readonly" style="border:0px;"></textarea>

pitchoo
06-25-2002, 10:50 AM
Ok thanks!

whackaxe
06-25-2002, 12:10 PM
there is also use of DIVs for example

<div id="text2mod"></div>

<script>
text2mod.innerHTML = "this is the new text"
</script>

this is very usefull for changing text without having a big box around it. i used this once to make a matric style typer. scared the hell out of my sister when she thought that one of her exs had nabbed the control off her computer!

pitchoo
06-25-2002, 12:19 PM
This was the method I was using temporarily although it's pretty useful to use and works with IE and Mozilla 1.0, I prefer to access an object by its value attribute when it's possible because of the possible HTML tags embedded in the innerHTML (<b> for example).

But thanks for your reply.