Events can represent everything from basic user interactions to automated notifications of things happening in the rendering model.
An HTML event can fires because of user action or browser action.
Here are some examples of HTML events:
- An HTML web page was finished loading
- An HTML web page was resized or closed
- An HTML element was clicked by the user
- An HTML input field was changed
- An HTML form was submitted
- An error occured
You can do something when an event occurs.
<button onclick="alert('The full date: ' + Date())">Press me to get the time</button>
<button onclick="displayFullDate()">Press me to get the time</button>
HTML Network Events
The ononline event is the opposite of the offline event.
Also use the navigator.onLine property to find out whether the browser is in online or offline mode (alert('Return true if browser is online, false if offline: ' + navigator.onLine);)