Explain about Events in Java Script
https://www.computersprofessor.com/2016/06/explain-about-events-in-java-script.html
Java
script is an event drives system. An event is any change that the user makes
to the state of browser. Java script event handling can be quit a complex
issue. Different manufactures have implemented their own ways of capturing
and handling events.
Where you want an action from the
user to load to some action from a script you will need to implement an event
handles. Event handles are java script functions which you associate with an
html element as part of its definition
in the html source code.
Each
of the event handles perform an identical task when they are called an alert
dialogue is used to display in the a message. The messages differ so that we
can interact which event has just occurred and which object caused it.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ex:
<html>
<body onLoad = “show( )” onUnload = “ say_Goodbye ( )”>
< script language = “
javascript”>
function show ( )
{
alert
(“ the page has loaded”);
}
function
say-goodbye( )
{
alert
(“ Thanks for visiting”);
}
< /script>
< /body>
< /html>
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|