在textarea JQM中,如何禁用“enter”或不允许使用enter?可以吗?
<textarea maxlength='200' name="comment" id="comment" data-mini="true" data-theme="a" cols="40" rows="3" ></textarea
>
提前致谢
最佳答案
你可以试试这个:
$("#comment").on("keypress", function (e) {
if (e.which === 13) {
e.preventDefault();
//alert("Keypress averted");
}
});
关于javascript - JQuery Mobile - 禁用 "enter"/script 以不允许使用 Enter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17133872/