I am pretty sure I used to test check boxes for the setSelectionRange
property and they did not have one. But that seems to have changed in some browsers (tested Firefox and Chrome).
I used to do a check for the setSelectionRange
property before making a selection like this:
if (el.setSelectionRange) {
el.setSelectionRange(0, 9999);
}
However, since check boxes appear to have the setSelectionRange
property this throws an error.
So how do I test now for whether a selection can be made or not?
Here is also a fiddle:
Aucun commentaire:
Enregistrer un commentaire