Java script is a scripting language intended to handle event, rise from different controls of HTML. If you want to learn java script then you need to first learn about event.
An event is generated by a control,page or any other type of
activity . Event is generated through user, software, browser,server etc. with
the help of event system acknowledge that
something is happening . Example of
different types of events are click,double click,mouse over , mouse out etc.
When an event is generated an event handler is require to capture that particular event. I have added some example of most fundamental event
in following code. After that you will be able handle some important event .