I have a dialog box that has an HTML5 input field with a type="time"
in it.
When the dialog appears, I want to default the editing to the "minutes" portion of the dialog. I can't see a way to do it.
Here is a jsFiddle example that tries to use:
$("#t")[0].setSelectionRange(3, 5);
to no avail.
Is there a way to do this?
NOTE: the w3c spec here specifically has this quote:
The following IDL attributes and methods do not apply to the element: checked, files, selectionStart, selectionEnd, and selectionDirection IDL attributes; select(), setRangeText(), and setSelectionRange() methods.
Which might mean this simply isn't possible.
NOTE 2: Chrome throws this error when attempting to call this method. Other browsers may throw different errors:
Uncaught InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable.
Just set it using some js.