How to disable the resizing of the textarea
📅November 29, 2021
In this short article, we will show you how to disable the resizing of the textarea. Usually, when we add a textarea element to a page, we can resize the textarea by dragging the icon in the lower right corner. So we will disable that property using CSS.
Checkout more articles on JavaScript
- Download a file using JavaScript
- Check if the string contains a valid Vimeo URL using JavaScript
- How to get the window size in JavaScript
- Navigator object in JavaScript
- 7 JavaScript One-Liners that you should know
CSS rule to disables resizing behavior of the textarea
We can use the `resize` property to disable the resizing behavior of the textarea element.
textarea {
resize: none;
}
List of the other options available for resize property.
- none - To disable the resizing of the textarea.
- both - Resize the element’s height and/or width.
- horizontal - The user can resize the element horizontally.
- vertical - Resize the element vertically.
- inherit - The element inherits the resize value of its parent.
That’s it for today.
Thank you for reading. Happy Coding..!! 🙂