InterviewSolution
Saved Bookmarks
| 1. |
Why do we use of every() method in JavaScript? |
|
Answer» In JavaScript, an onfocus event is TRIGGERED when ELEMENT gets focus. An example here displays that a USER TYPES in the TEXTBOX and the onfocus event is triggered, allowing the color of the text to change to yellow: <!DOCTYPE html> <html> <body> <h2>Type your name</h2> <input type="text" onfocus="display(this)"> <script> function display(z) { z.style.color = "yellow"; } </script> </body> </html |
|