Skip to Content
Introducing .NET 4.0: with Visual Studio 2010
book

Introducing .NET 4.0: with Visual Studio 2010

by Alex Mackey
February 2010
Beginner content levelBeginner
400 pages
11h 13m
English
Apress
Content preview from Introducing .NET 4.0: with Visual Studio 2010

12.3. Selecting Elements

jQuery's strength is the ease with which you can select and manipulate elements on the page. You have used a selector method already to select all <div> elements that have an ID of div1:

$("#div1").html("hello jQuery");

jQuery supports many different ways to select an element or elements that should meet all but the most awkward requirements. Table 12-1 lists examples of other selection methods you might want to use.

Table 12.1. Example Selection Methods
SelectorSelected
$("#div1")Selects a <div> with an ID of div1.
$("div")Selects all <div>s.
$("div.standardDiv")Selects all <div>s with a class of standardDiv.
$(".standardDiv")Selects all elements with a class of standardDiv.
$("#div4 #div5")Selects a <div> with an ID of ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET 3.5 For Dummies®

ASP.NET 3.5 For Dummies®

Ken Cox
ASP.NET 4 Unleashed

ASP.NET 4 Unleashed

Stephen Walther, Kevin Hoffman, Nate Dudek

Publisher Resources

ISBN: 9781430224556Purchase book