jQuery - Basics

1. A button click event that changes the text of a paragraph element

zZZzZzZzZ


2. A button click event that toggle the paragraph element between diplay and hide


I come and I go
Tell me all the ways you need me
I'm not here for long
Catch me or I go...


3. Attach an event handler to be fired when the mouse enters a div element. The event changes the background color of the div element
Concatenate an event handler to be fired when the mouse leaves an element. The event changes the background color to the previous one.


4. Animate a div element to move to the right when the mouse enters the element.
Notice that the 'position' css property is set to 'relative' so we can work with the 'float' propery with value 'left' and use the left side of the box as reference to move.
There is also a delay before executing the second event handler's code.


5. Listen for the form submit event, prevent the default form submission, and validate the form input data.