I have input field and i want to trigger keyboard enter button when user focus on that input. Is there anyway to do the same in jQuery or javascript?
Try this:
$('#some-input').keypress(function(event){
if(event.keyCode == 13){
$('#my-button').click();
}
});
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.