javascript-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, or change
What event is fired when a user clicks the “submit” button within a form?
submit
What does the event.preventDefault() method do?
it stops the default action from happening.
What does submitting a form without event.preventDefault() do?
it cause the the page to reload(refresh the page) and it would add the values to the url.
What property of a form element object contains all of the form’s controls.
elements property
What property of a form control object gets and sets its value?
value property
What is one risk of writing a lot of code without checking to see if it works so far?
it makes finding the errors more difficult.
What is an advantage of having your console open when writing a JavaScript program?
you can check the data every step of the way.