How to disable resizable property of textarea using JavaScript?


To disable resizable property, use CSS style −

textarea {
   resize: none;
}

To disable specific textarea with different attribute values, try the following. Let’s say the attribute is set to “demo” −

textarea[name=demo] {
   resize: none;
}

Let’s say the id attribute is “demo” −

<textarea id="demo"></textarea>

For the above,

#demo {
   resize: none;
}


Updated on: 13-Jun-2020

144 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements