-1

It's very weird but I can't remove the disabled property from input, the selector is right, I can hide it for exemple :

jQuery(".hideit1").hide();`

My input:

<input title="Adresse" name="billing[street][]" id="billing:street1" value="" id0="route" style="display: inline-block;" class="hideit1 input-text  required-entry disabled" type="text"> 

I tried:

jQuery(".hideit1").prop("disabled", false);
jQuery(".hideit1").removeAttr("disabled");
jQuery(".hideit1").prop('disabled', function (_, val) { return ! val; });
jQuery(".hideit1").removeProp('disabled');

All the solutions of this post.

Zakaria Acharki
  • 66,747
  • 15
  • 75
  • 101
prc
  • 187
  • 2
  • 14

3 Answers3

1

You have used a class, not an attribute. Use removeClass method instead.

Lasithe
  • 1,916
  • 1
  • 15
  • 20
1

There's no disabled attribute in your element, instead it have a class disabled so you could use the jQuery method .removeClass() to remove it like :

jQuery(".hideit1").removeClass("disabled");

setTimeout(function() {
  $(".hideit1").removeClass("disabled");
}, 1000);
.disabled {
  background-color: #dadbdc;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<input title="Adresse" name="billing[street][]" id="billing:street1" value="" id0="route" style="display: inline-block;" class="hideit1 input-text  required-entry disabled" type="text">
Zakaria Acharki
  • 66,747
  • 15
  • 75
  • 101
1

Try using

jQuery(".hideit1").removeClass('disabled');

or

jQuery(".hideit1").toggleClass('disabled');

You are trying to remove a property that isn't set, when it should be the class.

atoms
  • 2,993
  • 2
  • 22
  • 43