You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Check for form elements by property instead of specific element names #1
Check for an input name based on whether it has the property "readOnly" and the value is false instead of checking for element names. It's both faster and more accurate.
Actually, it seems like the most accurate way to detect a form element is to check if it has the "disabled" property (disregarding the value as disabled elements can't receive events).
Originally I was going to check for a readOnly element, but Firefox lets you move the cursor around in a readOnly element, so that seems useful to preserve.
changed the title [-]Check for readOnly property instead of specific element names[/-][+]Check for form elements by property instead of specific element names[/+]on Aug 14, 2015
To clarify, select elements don't have the readOnly property (if you can't believe it) which is why we can't use it. Clearly we can't agree on a single definition of read only in HTML :)
Activity
mojavelinux commentedon Aug 14, 2015
Actually, it seems like the most accurate way to detect a form element is to check if it has the "disabled" property (disregarding the value as disabled elements can't receive events).
That leaves us with:
Originally I was going to check for a readOnly element, but Firefox lets you move the cursor around in a readOnly element, so that seems useful to preserve.
[-]Check for readOnly property instead of specific element names[/-][+]Check for form elements by property instead of specific element names[/+]mojavelinux commentedon Aug 14, 2015
To clarify, select elements don't have the readOnly property (if you can't believe it) which is why we can't use it. Clearly we can't agree on a single definition of read only in HTML :)