Standard JavaScript Events Including those for Mobile Devices ( Ex. onTouchBegin, onLoad, etc.) and Animation and Transition Events

Javascript can react to different events in a page.

On Click

We can use On Click to start an event when the user clicks a button. For example:

On Load

When we use On Load the event is triggered when the page is done loading.

On Mouse Over and On Mouse Out

When we use On Mouse Over the event is triggered by going over the area with the mouse.

We believe in God, the Eternal Father, and in His Son, Jesus Christ, and in the Holy Ghost.

On Touch Begin

We can trigger an event on devices that have touch using On Touch.

Note: The example won't work unless you are on a touch device!

We believe that men will be punished for their own sins, and not for Adam’s transgression.

Event Listener

The event listener method allows us to attach an event handler to any DOM element.

For example we can use it with On Click:

Or we can use it with Mouse Move:

We believe that through the Atonement of Christ, all mankind may be saved, by obedience to the laws and ordinances of the Gospel.

Animation and Transition

We can use event handlers to control animations and transitions too.

In this example we use an animation:

And here we can see a transition when we hover over the element, and when it's done, we use JavaScript to change its color: