Manipulating element CSS

jQuery allows developers to access the CSS properties of DOM elements directly. This provides an easy way to alter the look and feel of your application based on data within your JavaScript. This recipe will show you how to manipulate DOM CSS in various elements.

Getting ready

You are going to need three files for this recipe. Using your editor of choice, create recipe-1.html, recipe-1.js, and recipe-1.css in the same directory as the latest version of the jQuery library.

How to do it…

Of the three files you have just created, open each one for editing and perform the following steps:

  1. Add the following HTML code to recipe-1.html; be sure to change the source location of the JavaScript included for the jQuery library, pointing ...

Get jQuery 2.0 Development Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.