Forms Flashcards
What event is fired when a user places their cursor in a form control?
Focus
What event is fired when a user’s cursor leaves a form control?
Blur
What event is fired as a user changes the value of a form control?
Input
What event is fired when a user clicks the “submit” button within a <form>?
Submit event
What does the event.preventDefault() method do?
Prevents an event from executing.
What does submitting a form without event.preventDefault() do?
Sends the data to a server
What property of a form element object contains all of the form’s controls.
Form Collection
What property of a form control object gets and sets its value?
What is one risk of writing a lot of code without checking to see if it works so far?
Code might not work as intended
What is an advantage of having your console open when writing a JavaScript program?
To check your code