HTML and CSS Reference
To select elements by their tag name, simply use the name of the tag. No special characters are needed:
// Select elements by their tag name.
$(“p"); // jQuery
jQuery has other nifty selectors that you can use, too. You can find a full list of these on the jQuery website: ht-
Other Benefits of Using jQuery
As well as providing handy ways to select elements, jQuery offers a lot of other useful functions. There are functions
for easily updating the properties and content of elements as well as manipulating CSS styling. There are even func-
tions available to help you add effects such as fades and animations to your web pages. The jQuery library also
provides a series of functions that make it easier to set up event listeners.
One of the biggest benefits of using jQuery is that the library accounts for the inconsistencies in browsers so that you
don't have to. As explained earlier in this topic, some browser vendors decided to implement technologies slightly
differently, whether it is a variation in how a particular function is named or whether a browser vendor decided to in-
clude a function at all. This means that it is often necessary to write multiple variations of the same code in order to
ensure that it will work in all web browsers. The jQuery library takes care of a lot of these inconsistencies for you so
that you can just focus on writing your programs.
That concludes the brief tour of jQuery. If you like the look of jQuery's simpler syntax, check out the documentation
Congratulations! You just learned the basics of a new programming language.
take advantage of the awesome new features introduced in HTML5.
also learned how the DOM works and what happens to your HTML and CSS code when the browser processes it.
You were introduced to a number of key programming concepts in this chapter, but it takes months (if not years) to
In the next chapter, you dig into some slightly more advanced HTML5 features, starting with native video and audio.
You learn how to embed videos and audio clips into your web pages and how to use the new skills that you acquired
in this chapter to create custom controls to manage playback.