私はJavaScriptを使用してテキストエリアにユーザーの入力を防ぐためにしようとしているに入力することを防止しようとしています。TEXTAREA
なぜこれは機能しませんか?
$("textarea").on("input", function (e) {
console.log("returning"); //This prints
e.preventDefault();
return false;
//Even though this code runs when text is inputed into the textarea, it still doesn't prevent user input. Shouldn't returning false do that?
});
https://stackoverflow.com/questions/32298064/preventdefault-not-working-in-on-input-function – Bsalex
の重複 'keydown'の代わりに、入力 – emil
入力イベントが発生してみてください_after_コントロールに入力があります。 https://developer.mozilla.org/docs/Web/Events/input _から引用 - ,