0

I have such problem, I have with type="checkbox" and also I'm using JAWS to read it. In IE11 JAWS read disabled checked checkbox as unchecked. I know that it is bug of IE so I need to delete attribute "disable" from and replace it with some other logic that will disable checkbox. I tried to add

 document.getElementById("check").disabled= true;

to my onclick() function, but still I have possibility to uncheck checked checkbox first time. Then it became disabled. Also in my onClick() I have another several functions, so onclick will be run. Could someone suggest me any solution?

Bohdan Myslyvchuk
  • 1,657
  • 3
  • 24
  • 39
  • See also: [When to use setAttribute vs .attribute= in JavaScript?](http://stackoverflow.com/a/36581696/4639281) –  Jan 18 '17 at 16:57

2 Answers2

2

This can be done using .setAttribute(attribute, value). Like so:

document.getElementById("check").setAttribute("disabled", "disabled");
Leon
  • 149
  • 8
-2

Maybe try this older solution for IE:

document.getElementById("check").disabled = "disabled";

and to remove it:

document.getElementById("check").disabled = "";

or document.getElementById("check").disabled = false;

Paul
  • 1,527
  • 2
  • 16
  • 24