We have a number of events we can listen for in form elements
input
fired on form elements when the element value is changedchange
fired on form elements when the element value is changed. In the case of textinput
elements andtextarea
, it’s fired only once when the element loses focus (not for every single character typed)cut
fired when the user cuts text from the form elementcopy
fired when the user copies text from the form elementpaste
fired when the user pastes text into the form elementfocus
fired when the form element gains focusblur
fired when the form element loses focus
Here’s a sample form demo on Codepen:
See the Pen Form events demo by Flavio Copes (@flaviocopes) on CodePen.