How to disable input type text area? Last Updated : 12 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report To disable an input type=text by using the input disabled attribute. A disabled input is un-clickable and unusable. It is a Boolean attribute. The disabled elements are not submitted in the form. Syntax: <input type="text" disabled>Example 1: To disable an input field of type "text" by using the disabled attribute within the <input> tag. The text input field is rendered with the value "This input field is disabled" and is non-editable due to the presence of the disabled attribute. html <!DOCTYPE html> <html> <head> <title>HTML input disabled Attribute</title> </head> <body style="text-align:center"> <h2>HTML input disabled Attribute</h2> <label>Input: <!--A disabled input--> <input type="text" name="value" value="This input field is disabled" disabled> </label> </body> </html> Output: Example 2: To disable an HTML textarea element, we can use the disabled attribute. The body element is styled with a black background color. The textarea:disabled selector targets disabled textarea elements and sets their background color to gray and text color to white. we can also adjust these styles as needed to achieve the desired look. HTML <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Disabled Textarea Example</title> <style> body { background-color: rgb(0, 0, 0); text-align: center; } h1, h2 { color: green; } textarea:disabled { background-color: gray; color: white; border: 2px blue solid; padding: 6px; } </style> </head> <body> <h2>Disabled Textarea Example</h2> <textarea disabled> This textarea is disabled. we can't write anything in this text area </textarea> </body> </html> Output: OutputSupported BrowsersApple Safari: 1.0Google Chrome: 1.0Firefox: 1.0Opera: 1.0 Comment More infoAdvertise with us Next Article How to Disable Textarea using JavaScript? M manaschhabra2 Follow Improve Article Tags : JavaScript HTML-Misc HTML-Questions Similar Reads How to Make Text Input Non-Editable using CSS? There are situations where you might want to create non-editable input fields. HTML and CSS both provide ways to achieve this.1. The read-only Attribute in HTMLThe read-only attribute in HTML is used to make a text input field non-editable, meaning users can see the content but cannot modify it. Thi 2 min read How to Disable Textarea using JavaScript? This article will show you how to disable the textarea using JavaScript. Disabling a textarea using JavaScript can be done by setting the disabled property of the textarea element to true. This prevents the user from editing the content of the textarea. There are some reasons to use disabled textare 2 min read How to Disable Input in JavaScript ? Disabling input fields in JavaScript is a common task when you want to restrict users from interacting with specific form elements. This can be useful in various scenarios, such as preventing modifications to fields that are conditionally locked or ensuring certain inputs are controlled programmatic 2 min read How to Disable Text Selection in HTML with CSS? Disabling text selection in HTML can be useful in scenarios where you want to prevent users from copying text, dragging elements, or accidentally selecting text while interacting with web page elements.These are the following approaches:Table of ContentUsing user-select PropertyUsing Vendor Prefixes 2 min read Semantic-UI Input Disabled State Semantic UI is an open-source framework that uses CSS and jQuery to build great user interfaces. It is the same as a bootstrap for use and has great different elements to use to make your website look more amazing. Semantic UI has a bunch of components for user interface design. One of them is the I 3 min read How to change the font-color of disabled input using CSS ? In this article, we are going to learn how to change the font-color of disabled input. There is a method to solve this problem, which is discussed below: Approach: With adding basic CSS property we are able to change the font-color of a disabled input. The disabled input element is unusable and un-c 2 min read Like