faqts : Computers : Programming : Languages : JavaScript : Forms : TextAreas/TextFields

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

23 of 27 people (85%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

Can I change the wrap attribute of a textarea?

Jun 4th, 2000 06:00
Martin Honnen, Joe T,


IE4+ and NN6 make that attribute scriptable, but only IE4+ changes the 
display currently. NN2/3/4 can't change that attribute.
<HTML>
<HEAD>
</HEAD>
<BODY>
<FORM NAME="aForm">
<INPUT TYPE="button" VALUE="set wrap soft"
       ONCLICK="this.form.aTextArea.wrap = 'soft';
                "
>
<INPUT TYPE="button" VALUE="set wrap hard"
       ONCLICK="this.form.aTextArea.wrap = 'hard';
               "
>
<INPUT TYPE="button" VALUE="set wrap off"
       ONCLICK="this.form.aTextArea.wrap = 'off';
                "
>
<BR>
<TEXTAREA NAME="aTextArea" ROWS="5" COLS="10" WRAP="off">
Kibology for all.
</TEXTAREA> 
</FORM>
</BODY>
</HTML>