Karthik Subramani
Karthik Subramani

Reputation: 15

How to make the readonly checkbox to disable-true?

The checkbox is disabled readOnly. In that checkbox, I have tried to use the following code but it's not working.

$(".FlagClass").prop("disabled", true);

I need to disable true in the checkbox

Upvotes: 0

Views: 43

Answers (3)

Danilo
Danilo

Reputation: 148

if the class is in an input type element:

$('.FlagClass').attr('readonly',false);

if you want to remove the attribute that you have

$(".FlagClass").removeAttr('readonly');

Or:

$('.FlagClass').removeAttr('disabled');

also

$('.FlagClass').attr('disabled', false);

Upvotes: 0

Engels Rodriguez
Engels Rodriguez

Reputation: 9

Try with attr instead

$(".FlagClass").attr("disabled", false);

Upvotes: 1

Stevan Tosic
Stevan Tosic

Reputation: 7199

Have you tried with disabled?

$(".FlagClass").prop("disabled", 'disabled');

or

$(".FlagClass").attr("disabled", true);

Upvotes: 0

Related Questions