Problem removing readonly in Internet Explorer [closed]

2

I have a function that removes readonly from a field after focusing on it: $input.removeAttr('readonly');

The problem is that only in Internet Explorer even after removing the readonly it does not allow me to type in the field. The problem only resolves if I leave the field and focus on it again. I would like a solution where I would not have to use the event blur and focus , as I have other behaviors involving the blur function.

    
asked by anonymous 27.04.2015 / 20:09

1 answer

0

You should use $input.prop('readonly', false);

Use .prop instead of .attr " because readonly is a native property of the element and its state is set and read via .prop() .

    
27.04.2015 / 21:05