Javascript examples for DOM Event:onfocusin
The onfocusin event occurs when an element is about to get focus.
Bubbles | Yes |
---|---|
Cancelable | No |
Supported HTML tags: | ALL HTML elements, EXCEPT: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title> |
<!DOCTYPE html> <html> <body> Enter your name: <input type="text" id="fname" onfocusin="myFunction()"> <script> function myFunction() {//from w w w .j a va2 s . c o m document.getElementById("fname").style.backgroundColor = "red"; } </script> </body> </html>