ã¨ã³ã¿ã¼ï¼Enterï¼ãã¼ãæ¼ããã¨ãã«ãã©ã¼ã ï¼Formï¼ãéä¿¡ï¼Submitï¼ããã®ãJavaScriptã§ç¡å¹ã«ããæ¹æ³ãç´¹ä»ãã¾ãã ã¨ã³ã¿ã¼ãã¼ãæ¼ããããã©ããã®å¤å®ã¯keydownã¤ãã³ãã§è¡ãã¾ãã ãã®ãããã¾ãã¯å¶å¾¡ããããã©ã¼ã ã®ã³ã³ããã¼ã«ã«keydownã®ã¤ãã³ããå®ç¾©ãã¾ãã // 対象ã®ãã©ã¼ã ã³ã³ããã¼ã«ãåå¾ const form = document.getElementById('form1'); // ãã©ã¼ã ã®keydownã¤ãã³ããè¨å® form.addEventListener('keydown', function (event) { }); keydownã¤ãã³ãã®ãã©ã¡ã¼ã¿eventã«æ¼ããããã¼ã®æ
å ±ãããã¾ãã event.keyCodeã§ãã¼ã®æ
å ±ãåå¾ã§ãã¾ãã ã¨ã³ã¿ã¼ãã¼ãæ¼ãããå ´åã¯event.keyCodeã«13ãã»ãã
{{#tags}}- {{label}}
{{/tags}}