by Sai gowtham

How to disable the textarea element from resizing

In this tutorial, we are going to learn about how to disable the html textarea element from resizing.

By default textarea element is enabled for resizing so that we can resize it by dragging the mouse on the bottom right corner.

To disable resizing we need to add a css resize property with value none.

Here is an example:

textarea {
    resize:none;
}

If you want to disable for a particular textarea element first, you need to select that element using id or class attribute then add a resize property.

<textarea id="feedback" rows="5" cols="33"></textarea>
#feedback{
    resize:none;
}

Top Udemy Courses

JavaScript - The Complete Guide 2020 (Beginner + Advanced)
JavaScript - The Complete Guide 2020 (Beginner + Advanced)
45,614 students enrolled
52 hours of video content
View Course
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
284,472 students enrolled
40 hours of video content
View Course
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
130,921 students enrolled
21 hours of video content
View Course