O'Reilly logo

jQuery for Designers : Beginner's Guide - Second Edition by Natalie MacLees

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – creating simple tabs

Perform the following steps to turn a list of links into tabs:

  1. We'll get started with our basic HTML file and associated folders, like we created in Chapter 1, Designer, Meet jQuery. Inside the <body> tag, we'll start by setting up a simple example that will work even for users with JavaScript disabled. We'll put a list of anchor links to different areas of the page at the top and then wrap each of our content sections in a div block with an ID, as shown in the following code:
    <header class="content"> <h1>Noble Gases</h1> <p>Odorless, colorless, monatomic gases with very low chemical reactivity</p> </header> <ul id="tabs"> <li><a href="#he">He</a></li> <li><a href="#ne">Ne</a></li> <li><a href="#ar">Ar</a></li> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required