Lesson 8: Introduction to JavaScript and jQuery

web10.psd

In this lesson, you’ll learn the fundamentals of adding interactivity to your pages with JavaScript and the jQuery JavaScript library.

What you’ll learn in this lesson:

  • An overview of how to use JavaScript
  • How to use the jQuery JavaScript library

Starting up

You will work with several files from the HTML5_08lessons folder in this lesson. Make sure you have loaded the HTML5lessons folder onto your hard drive from www.digitalclassroombooks.com/HTML5. See “Loading lesson files” in the Starting Up section of this book.

3054.jpg This lesson uses the TextWrangler text editor to create the markup, but you can use any text editor and achieve the same results.

Interactivity on the Web

The Web is an interactive medium by nature, and hyperlinks are good examples of this. Even the most basic website requires user interaction, and the decisions made by the designer can affect the user’s perception of the site as well as their experience. HTML offers very few possibilities for interaction, but by adding CSS, you have options such as CSS rollovers and the ability to style hyperlinks. CSS does have certain limitations, which you can overcome by using the JavaScript scripting language and interactive media such as Flash.

A form button with no JavaScript ...

Get HTML5 Digital Classroom now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.