UncleCoder.com

UncleCoder.com

Free programming examples and instructions

Remove disabled attribute from html control

Code and Demo for How to remove disabled attribute using jQuery

by Athil


Posted on 06 May 2017 Category: jQuery Views: 791

Edited on 07 Aug 2017



DEMO

Hi, Here I am going to show how to remove disabled attribute from HTML control using jquery.

$('#controlid').prop('disabled', false);

 

 Full Example

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
    <input type ="text" id="txt1" disabled="true">
    <button id="disable" onclick="removedisable();">Set enabled</button>
</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:


Advertisement