wrap textarea using javascript

Discussion in 'JavaScript' started by MayurGondaliya, Feb 5, 2010.

  1. #1
    I am having problem with setting up textarea's warp attribute.

    I am using this.

    document.getElementById('textareaid').wrap = 'hard';

    But, it does not seem to be putting the change. Can anyone help?
     
    MayurGondaliya, Feb 5, 2010 IP
  2. rainborick

    rainborick Well-Known Member

    Messages:
    424
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    120
    #2
    There's no longer an attribute for <textarea> named "wrap" in the HTML specs. Sounds like it might be depreciated. You might achieve the effect you want with the CSS property 'white-space'.
     
    rainborick, Feb 5, 2010 IP
  3. MayurGondaliya

    MayurGondaliya Well-Known Member

    Messages:
    1,233
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    170
    #3
    I will give it a try. Thanks for your help.
     
    MayurGondaliya, Feb 5, 2010 IP