JavaScript Events


The web is a dynamic environment where a lot of things happen. Most appropriately, they’re called events. Some of these events, like a user clicking a button or moving the mouse over a link, are of great interest to a JavaScript coder.

events

  1. onClick event: triggered by you as you click the link;
  2. onUnload event: triggered by the web browser as it leaves the current web page;
  3. onLoad event: triggered by the browser as the new web page content is loaded.

Example specified below

<a href="http://html.net" onclick="alert('Going anywhere? Not so fast!'); return false;">Click Me!</a>
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s