[英]How to Close mobile keyboard when pressed enter JQuery
I have an input that doesn't have any buttons or forms.我有一个没有任何按钮或 forms 的输入。 I want to hide the mobile keyboard after pressing enter on mobile phone (arrow one).
我想在手机上按回车后隐藏手机键盘(箭头一)。
I have tried this:我试过这个:
$(document).ready( function () {
$("input").keyup(function(event) {
if (event.keyCode === 13) {
//do something
}
});
});
but I don't know what to do after the if
statement.但我不知道在
if
语句之后该怎么做。
You can use jQuery blur method, I am pretty sure that would work.您可以使用 jQuery 模糊方法,我很确定它会起作用。
https://api.jquery.com/blur/ https://api.jquery.com/blur/
$("input").blur();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.