Reputation: 14815
I'm trying to change the value of an input
with type time
but I can't find a solution.
This is my attempt:
$("input").val("10.15");
Fiddle: http://jsfiddle.net/bUYC6/
How can I do?
Upvotes: 6
Views: 23375
Reputation: 11862
As you may know, you must provide a RFC3339 Standardised time format. Explained in the Internet Date/Time Formats Document Spec. So a clean input would be:
$("input").val( "18:01:07" );
Although I believe you're trying to input a secfrac (A fraction of a second..) as explained in the above link, which you could apply:
<input type="time" value="" step="0.10" />
<script>
$("input").val( "00:00:00.10" );
</script>
Which understandably isn't a clean method, but I don't think <input type="time" />
is best worked with time-fractions.
Upvotes: 8
Reputation: 1719
you can try this:
$("#someid").val("10:15");
It work's fine here.
Upvotes: 1