How to specify that an input element should be disabled? Last Updated : 19 Jun, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report The disabled attribute for <input> element is used to specify that the input field is disabled. A disabled input is un-clickable and unusable. It is a boolean attribute. The disabled <input> elements are not submitted in the form. Syntax:<input disabled>Example: In this example, to specify that an input element should be disabled in HTML, add the disabled attribute to the input tag. This attribute prevents users from interacting with the input field, visually indicating its disabled state. When the disabled attribute is present, it specifies that the input field is disabled. We can not write any content on the disabled input field. HTML <!DOCTYPE html> <html> <head> <title> How to specify that an input element should be disabled in HTML? </title> <style> label { display: block; padding: 10px; } </style> </head> <body style="text-align:center"> <h2> Input element <br>should be disabled in HTML </h2> <label>Disabled Input Field: <!--A disabled input--> <input type="text" name="value" value="This input field is disabled" disabled> </label> <label>Input Field <!--A disabled input--> <input type="text" name="value" value="Not disabled"> </label> </body> </html> Output: OutputSupported BrowsersApple Safari: 1.0Google Chrome: 1.0Firefox: 1.0Opera: 1.0 Comment More infoAdvertise with us Next Article How to specify that an input element should be disabled? V vkash8574 Follow Improve Article Tags : CSS CSS-Misc HTML-Misc HTML-Questions CSS-Questions +1 More Similar Reads How to specify that a keygen element should be disabled in HTML ? The <keygen>element in HTML helps in encryption key generation so that data can be transferred between the server and client securely. This encryption may affect the user experience and reduce website performance in the case of users with fewer system requirements. This can cause issues in the 1 min read How to specify that an option should be disabled in HTML5 ? The <select> tag is used to create a drop-down list in an HTML document. Generally, it is used in the forms when some data is to be collected from the user. By default, all the values or options can be chosen or selected from the drop-down list created using the <select> element. However 2 min read How to specify whether an input element should have autocomplete disabled or not ? The autocomplete attribute specifies whether an autocomplete input field should be enabled. The browser can predict the value using autocomplete. The browsing options to fill in the field, based on earlier typed values, should be shown for the user while typing a field. If the autocomplete feature i 2 min read How to specify that a group of related form elements should be disabled using HTML? In this article, we will learn how to specify that a group of related form elements should be disabled using HTML. When the disabled attribute is present, it specifies that the input field is disabled. We can not write any content in a disabled input field. Approach: We will be using the disabled at 1 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