jQuery | disable/enable an input element Last Updated : 28 Mar, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The disable/enable an input element in jQuery can be done by using prop() method. The prop() method is used to set or return properties and values for the selected elements. Example 1: This example uses prop() method to disable the input text field. html <!DOCTYPE html> <html> <head> <title> JavaScript enable/disable an input element </title> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> </head> <body style = "text-align:center;"> <h1 style = "color:green;" > GeeksForGeeks </h1> <input id = "input" type="text" name="input"/> <button onclick="enable_disable()"> Enable/Disable </button> <!-- Script to disable input text area --> <script> function enable_disable() { $("input").prop('disabled', true); } </script> </body> </html> Output: Before clicking the button: After clicking the button: Example 2: This example uses prop() method to enable the input text field. html <!DOCTYPE html> <html> <head> <title> JavaScript enable/disable an input element </title> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> </head> <body style = "text-align:center;"> <h1 style = "color:green;" > GeeksForGeeks </h1> <input id = "input" type="text" name="input" disabled/> <button onclick="enable_disable()"> Enable/Disable </button> <!-- Script to enable input text fields --> <script> function enable_disable() { $("input").prop('disabled', false); } </script> </body> </html> Output: Before clicking the button: After clicking the button: Comment More infoAdvertise with us Next Article jQuery Mobile Textinput disable() Method P PranchalKatiyar Follow Improve Article Tags : JQuery Similar Reads How to enable/disable all input controls inside a form element using jQuery ? Give an HTML document containing a form element. The form element contains input elements, option elements, and button elements. The task is to enable or disable all input controls inside a form using jQuery. It can be done by using prop() method. Using prop() Method: It is used to set or return the 3 min read How to find all input elements that are enabled using jQuery? The jQuery " :enabled" pseudo-class selector helps to find all the input element that are enabled. This pseudo-class selector should only be used for selecting HTML elements that support the disabled attribute i.e (<button>, <input>, <textarea>, <select>, <option>, < 2 min read How to find all elements that are disabled in jQuery ? In this article, we will learn how to find all elements on the page that are disabled using jQuery. Approach: The :disabled selector can be used to get all elements on the page that are currently disabled. These elements are iterated over using the each() method. The elements can then be individuall 2 min read How to enable/disable a button using jQuery ? Enabling/disabling a button using jQuery involves altering its functionality to either accept user input or not. This is typically done by manipulating its 'disabled' property or attribute through jQuery methods like `.prop()` or .attr().To enable/disable a button using jQuery, you'll need a basic H 2 min read jQuery Mobile Textinput disable() Method jQuery Mobile is a web-based technology used to make responsive content that can be accessed on all smartphones, tablets, and desktops. In this article, we will be using the jQuery Mobile Textinput disable() method to disable the textinput like textbox, textarea, etc. It does not accept any paramete 1 min read How to Disable a Button in jQuery UI ? To disable a button in jQuery UI, we will be using disable() method which is discussed below: jQuery UI disable() method is used to completely disable the button. It returns the button element completely to its initial state. Syntax: $(".selector").button("disable") Parameters: This method does not 2 min read Like