UncleCoder.com

UncleCoder.com

Free programming examples and instructions

Remove disabled attribute from html control using jQuery

Demo and Code for how to remove disabled attribute from jQuery.

by Athil


Posted on 01 Jan 0001 Category: jQuery Views: 2227


Here I am going to show how to remove 'disabled' attribute from HTML control using jQuery.

DEMO

$('#txt1').prop('disabled', false);
Where 'txt1' is control id.

Full Demo code

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Demo jQuery remove disbaled attriute from html control</title>
</head>
<body>
    <h1>Demo jQuery remove disbaled attriute from html control</h1>
    <input type ="text" id="txt1" disabled="true">
    <button id="disable" onclick="removedisable();">Set enabled</button><br/>
</body>

 
        <script type="text/javascript" src="js/jquery.min.js" ></script>

       <script type="text/javascript">
           function removedisable()
           {
               $('#txt1').prop('disabled', false);
           }
        </script>

</html>

 

 



Leave a Comment:


Click here to register

Popular articles