-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
jQuery 2.0 Development Cookbook
By :
Having the ability to detect if a user has clicked on elements other than buttons can provide additional flexibility to your web application. You can attach click events to any HTML elements, just as we did with the buttons in the previous recipe.
To work through this recipe, we are first going to need a blank HTML page named recipe-2.html, the same as in the other recipes. Remember that you need to have the latest version of jQuery downloaded and easily accessible on your computer so that it can be included in recipe-2.html.
To understand how you can detect user clicks on elements other than buttons, perform the following steps:
Add the following HTML to the recipe-2.html page you have just created. This HTML creates a very basic web page with an input, an anchor, and a division element.
<!DOCTYPE html>
<html>
<head>
<title>Chapter 2 :: jQuery Events</title>
<script src="jquery.min.js"></script...
Change the font size
Change margin width
Change background colour