This script doesn't work on mobile chrome:
function check() {
document.getElementById("sh").checked = false;
}
Can you recommend an alternative which work on Android Chrome?
This script doesn't work on mobile chrome:
function check() {
document.getElementById("sh").checked = false;
}
Can you recommend an alternative which work on Android Chrome?
I can give you alternatives that should work fine in modern desktop browsers but I have no idea about Android, so here goes...
Toggle its state...
sh.checked=!sh.checked;
Remove the atttribute...
sh.removeAttribute('checked');
Btw, you don't need to use getElementById('') if you know the ID, just use the ID directly.
Btw, I'm not surprised that...
sh.checked = false;
...doesn't work because the checked attribute was not really designed to be a boolean.
Had it been a boolean then assigning "checked" to it would always equate to false.
Booleans can only accept true or false.
So the Android JS engine you're using has the correct behavior IMHO..