jQuery provides the developer with ways to handle built-in JavaScript events with functions such as .click()
, .hover()
, and others. jQuery also allows developers to create their own event types for additional functionality. With the creation of custom events, developers are also able to pass data around their application more easily.
Create another blank HTML document named recipe-10.html
in an easily accessible location.
Learn how to create a custom event using jQuery by performing the following steps:
Add the following HTML code to this newly created HTML document. Remember to update the reference to the jQuery library to point to its local location on your computer.
<!DOCTYPE html> <html> <head> <title>Chapter 2 :: jQuery Events</title> <script src="jquery.min.js"></script> <script> </script> </head> <body> <button rel="green">Green</button>...