This is a great Event Handler that allows you to create action when the reader uses the mouse, tabs or arrow keys to focus on one item on your webpage. This works for form object drop-down boxes, text boxes, and textarea boxes. Here is an example of a script that writes text to the status bar when the user lets the browser know where their focus is by clicking into one of the two input boxes:
HTML file: | Displayed by browser: |
---|---|
<body>
<FORM> <INPUT TYPE="text" SIZE="30" onFocus="window.status='Write your name in the box';"> <INPUT TYPE="text" SIZE="50" onFocus="window.status='Write your address here';"> </FORM> </body> |