setfocus the data in textfield after scan barcode
i'm u开发者_高级运维sing jQuery for my task. Then i'm using barcode scanner for input data into my input form. how do i do to show data(setfocus) in the 2nd textfield, if i have two textfields inside this form?
You can use :eq()
or .eq()
to get the second <input>
then call .focus()
, like this:
$("form input:text:eq(1)").focus()
Note that it's 1
because it's a 0-based index.
精彩评论