JqueryNo Comments

default thumbnail

You can add or remove attribute accordingly to your need in jquery. You can add disabled or readonly in input type element. To make the disable a button we use attr.

HTML

<a href="#0" id="add">Add Disabled</a>
<a href="#0" id="remove">Remove Disabled</a>
<input type="text" id="test">

You can add or remove attribute in input type having test id.

Jquery

$( "#add" ).click(function() {
  $("#test").attr("disabled","disabled");
});
$( "#remove" ).click(function() {
  $("#test").removeAttr("disabled");
});

Be the first to post a comment.

Add a comment