javascript event එකක් කියන්නේ web browser එකේ වෙන action එකක්.javscript event වලට HTML elements වලට react කරන්න පුලවන්.
For example, when users click a button on a webpage, you may want to respond to this click event by displaying a dialog box. ඒ කිවේ user button කියන html elemet එක click කරාම dialog box එකක් display වෙලා event එකක් trigger වෙනවා.
Common Events
Ways Of Event Handling In JavaScript
- Inline Event Handling
මෙතනදී වෙන්නේ onclick, onsubmit වගේ html event වලට directly javascript embaded කරන එක.The example given below shows you how to do inline event handling
2. By using a separate function
3. By using an event listener
In the next article, I am going to write about event flow in javscript.
if there is something that you cannot agree with or something that needs to be added, please let me know through a response (comment).
you can find more information from the following sources