5 Input Events That You Will Use At Least One Of Them In Your Next Projects.

Hello,
I’m Aya Bouchiha,
today, we’ll discuss 5 input events that you will use at least one of them in your next projects.

firstly, we need to know that handling events can be done with:

onEventName

example:

showButton.onclick = handleClick;


This content originally appeared on DEV Community and was authored by Aya Bouchiha

Hello,
I'm Aya Bouchiha,
today, we'll discuss 5 input events that you will use at least one of them in your next projects.

firstly, we need to know that handling events can be done with:

  • onEventName

example:

showButton.onclick = handleClick;
  • addEventListener('eventName', function)

example:

showButton.addEventListener('click', handleClick)
  • The event as a attribute (onEventName="function()")
<button onclick="doSomething()"></button>

blur and focus

focus: This happens when the user focuses on the input field.
blur: happens when the user leaves the input field.

input

input: This happens immediately when the user changes the input's value.

reset

reset: This happens when a form is reset by clicking to a reset input or a reset button.

submit

submit: This happens when a form is submitted, by clicking a submit button or a submit input.

Summary

  • focus happens when the user leaves the input field.
  • blur: happens when the user focuses on the input field.
  • input: happens immediately when the user changes the input's value.
  • reset: happens when a form is reset.
  • submit: This happens when a form is submitted.

References

References

Suggested Posts

To Contact Me:

Happy codding!


This content originally appeared on DEV Community and was authored by Aya Bouchiha


Print Share Comment Cite Upload Translate Updates
APA

Aya Bouchiha | Sciencx (2021-08-05T00:30:31+00:00) 5 Input Events That You Will Use At Least One Of Them In Your Next Projects.. Retrieved from https://www.scien.cx/2021/08/05/5-input-events-that-you-will-use-at-least-one-of-them-in-your-next-projects/

MLA
" » 5 Input Events That You Will Use At Least One Of Them In Your Next Projects.." Aya Bouchiha | Sciencx - Thursday August 5, 2021, https://www.scien.cx/2021/08/05/5-input-events-that-you-will-use-at-least-one-of-them-in-your-next-projects/
HARVARD
Aya Bouchiha | Sciencx Thursday August 5, 2021 » 5 Input Events That You Will Use At Least One Of Them In Your Next Projects.., viewed ,<https://www.scien.cx/2021/08/05/5-input-events-that-you-will-use-at-least-one-of-them-in-your-next-projects/>
VANCOUVER
Aya Bouchiha | Sciencx - » 5 Input Events That You Will Use At Least One Of Them In Your Next Projects.. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/08/05/5-input-events-that-you-will-use-at-least-one-of-them-in-your-next-projects/
CHICAGO
" » 5 Input Events That You Will Use At Least One Of Them In Your Next Projects.." Aya Bouchiha | Sciencx - Accessed . https://www.scien.cx/2021/08/05/5-input-events-that-you-will-use-at-least-one-of-them-in-your-next-projects/
IEEE
" » 5 Input Events That You Will Use At Least One Of Them In Your Next Projects.." Aya Bouchiha | Sciencx [Online]. Available: https://www.scien.cx/2021/08/05/5-input-events-that-you-will-use-at-least-one-of-them-in-your-next-projects/. [Accessed: ]
rf:citation
» 5 Input Events That You Will Use At Least One Of Them In Your Next Projects. | Aya Bouchiha | Sciencx | https://www.scien.cx/2021/08/05/5-input-events-that-you-will-use-at-least-one-of-them-in-your-next-projects/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.