Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script tag inside <textarea> 1

Status
Not open for further replies.

jgonc

Programmer
Aug 10, 2010
4
PT
Hello everybody!

I think this is simple but can't get it to work.

I am trying to pass a javascript variable into a <textarea> HTML tag... but with no avail. I wrote the following code:

<textarea id='estilizada' cols='64' rows='21' wrap='hard' readonly='yes'><script>document.write(dd[1]);</script>

It's not a variable issue because if i put it into a <p> it displays well. And I do not want to trigger the string passage with onclick events whatsoever.

Thanks in advance.
 
Hi

There can be no HTML tags inside [tt]textarea[/tt].
Code:
[b]<textarea[/b] [maroon]id[/maroon][teal]=[/teal][green][i]'estilizada'[/i][/green] [maroon]cols[/maroon][teal]=[/teal][green][i]'64'[/i][/green] [maroon]rows[/maroon][teal]=[/teal][green][i]'21'[/i][/green] [maroon]wrap[/maroon][teal]=[/teal][green][i]'hard'[/i][/green] [maroon]readonly[/maroon][teal]=[/teal][green][i]'yes'[/i][/green][b]></textarea>[/b]
[b]<script>[/b]
document[teal].[/teal][COLOR=darkgoldenrod]getElementById[/color][teal]([/teal][green][i]'estilizada'[/i][/green][teal]).[/teal]value[teal]=[/teal]dd[teal][[/teal][purple]1[/purple][teal]];[/teal]
[b]</script>[/b]


Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top