javascript-forms Flashcards
What event is fired when a user places their cursor in a form control?
Focus event.
What event is fired when a user’s cursor leaves a form control?
blur event
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 ?
submit
What does the event.preventDefault() method do?
Prevents default functionality from happening.
What does submitting a form without event.preventDefault() do?
The default functionality of an element happens.
What property of a form element object contains all of the form’s controls.
The .elements() property. For example input.elements;
What property of form a control object gets and sets its value?
The HTMLFormElement.
What is one risk of writing a lot of code without checking to see if it works so far?
You’ll have to deal with your code breaking and spend more time searching for the bugs.
What is an advantage of having your console open when writing a JavaScript program?
It helps you notice bugs quickly and you can get to fixing it before it becomes a huge problem.