简体   繁体   中英

JS / Jquery - Focusing to the next input field from the event.target

Trying to have it so when a link is clicked aside one input, it will hide that link and focus to the input field in the next div. I need to reference it with an event-target for other reasons.

If I change .focus(); to .val('blah'); it works, and other, more typical methods ie $('a').click(function() {... will do the job. Is this just a limitation of using event-target?

Here is a fiddle

Your mousedown event does'nt trigger the handler, you'll need to use click() instead.

Something like this FIDDLE

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM