js onfocusout event
HTML[Edit]
+
0
-
0
js onfocusout event
1<input type="text" onfocusout="handleFocusout()">
[Edit]
+
0
-
0
js onfocusout event
1 2 3 4 5 6 7 8 9 10 11 12 13 14<!doctype html> <html> <body> <p>Click on the input field to set focus, then click outside it.</p> <input type="text" id="my-input"> <script> var myInput = document.querySelector('#my-input'); myInput.addEventListener('focusout', function() { console.log('onfocusout event occurred.'); }); </script> </body> </html>
[Edit]
+
0
-
0
js onfocusout event
1 2 3 4 5 6 7 8 9 10 11 12<!doctype html> <html> <body> <p>Click on the input field to set focus, then click outside it.</p> <input type="text" onfocusout="handleFocusout()"> <script> function handleFocusout(){ console.log('onfocusout event occurred.'); } </script> </body> </html>