- Home
- Products
- Integration
- Tutorial
- Barcode FAQ
- Purchase
- Company
Basic Selectors in Visual C#.NET
Basic Selectors QR Code 2d Barcode Creator In C#.NET Using Barcode generation for .NET framework Control to generate, create QR Code ISO/IEC18004 image in .NET framework applications. www.OnBarcode.comScanning QR Code 2d Barcode In C# Using Barcode recognizer for VS .NET Control to read, scan read, scan image in .NET applications. www.OnBarcode.comA query is characterized by a selector. A selector is simply the expression that, when properly evaluated, selects one or more DOM elements. In jQuery, you have three basic types of selectors based on ID, CSS, or tag name. In addition, a selector can result from the composition of multiple simpler selectors combined using ad hoc operators. In this case, you have a compound selector. An ID selector picks up DOM elements by ID. An ID selector commonly selects only one element unless multiple elements in the page share the same ID this condition violates the HTML DOM standard, but it is not too unusual in the real world. Here s the syntax of an ID selector: Barcode Generation In Visual C# Using Barcode creation for Visual Studio .NET Control to generate, create barcode image in Visual Studio .NET applications. www.OnBarcode.comDecoding Bar Code In Visual C# Using Barcode scanner for .NET framework Control to read, scan read, scan image in Visual Studio .NET applications. www.OnBarcode.com// Select all elements in the context whose ID is Button1 $("#Button1") QR Code Drawer In VS .NET Using Barcode generation for ASP.NET Control to generate, create Denso QR Bar Code image in ASP.NET applications. www.OnBarcode.comQR Code Generator In .NET Using Barcode maker for Visual Studio .NET Control to generate, create QR Code image in .NET framework applications. www.OnBarcode.comThe leading # symbol just tells jQuery how to interpret the following text. A CSS-based selector picks up all elements that share the given CSS class. The syntax is shown here: Denso QR Bar Code Generator In Visual Basic .NET Using Barcode printer for Visual Studio .NET Control to generate, create QR image in .NET framework applications. www.OnBarcode.comPainting DataMatrix In Visual C#.NET Using Barcode generation for .NET framework Control to generate, create Data Matrix ECC200 image in .NET framework applications. www.OnBarcode.com// Select all elements in the context styled with the specified CSS class $(".header") Matrix Barcode Drawer In Visual C# Using Barcode creation for .NET framework Control to generate, create 2D Barcode image in VS .NET applications. www.OnBarcode.comGenerating 1D In Visual C# Using Barcode printer for .NET framework Control to generate, create 1D Barcode image in Visual Studio .NET applications. www.OnBarcode.comPart V
PDF-417 2d Barcode Generator In C#.NET Using Barcode drawer for .NET Control to generate, create PDF-417 2d barcode image in VS .NET applications. www.OnBarcode.comGenerating Identcode In Visual C#.NET Using Barcode printer for .NET framework Control to generate, create Identcode image in .NET applications. www.OnBarcode.comThe Client Side
Draw Barcode In VS .NET Using Barcode creator for Reporting Service Control to generate, create bar code image in Reporting Service applications. www.OnBarcode.comBar Code Encoder In .NET Using Barcode printer for Visual Studio .NET Control to generate, create bar code image in .NET applications. www.OnBarcode.comIn this case, the leading dot (.) symbol tells jQuery to interpret the following text as a CSS style name. Finally, a tag-based selector picks up all elements with the specified tag, such as all IMG tags, all DIV tags, or whatever else you specify. In this case, the selector consists of the plain tag name no leading symbol is required: Quick Response Code Generation In Objective-C Using Barcode printer for iPhone Control to generate, create QR Code image in iPhone applications. www.OnBarcode.comEncode EAN / UCC - 13 In None Using Barcode creator for Software Control to generate, create GTIN - 128 image in Software applications. www.OnBarcode.com// Select all IMG elements in the context $("img") ECC200 Decoder In Java Using Barcode decoder for Java Control to read, scan read, scan image in Java applications. www.OnBarcode.comGenerate Code 128 Code Set B In Java Using Barcode creator for Java Control to generate, create USS Code 128 image in Java applications. www.OnBarcode.comAs mentioned, you can also concatenate two or more selectors to form a more specific one.
Print PDF417 In None Using Barcode generator for Excel Control to generate, create PDF-417 2d barcode image in Excel applications. www.OnBarcode.comDecode Code 3 Of 9 In C# Using Barcode decoder for .NET framework Control to read, scan read, scan image in .NET applications. www.OnBarcode.comCompound Selectors
Concatenation is possible through a number of operators. For example, the white space picks up all elements that satisfy the second selector and are descendants of those matching the first. Here s an example: // Select all anchors contained within a DIV $("div a") The selector just shown is functionally equivalent to the following jQuery expression: $("div").find("a"); Similar to the white space, the > operator selects elements that are direct child elements (and not just descendants) of the elements matched by the first selector: // All anchors direct child elements of a DIV $("div > a") The preceding selector is functionally equivalent to the following jQuery expression: $("div").children("a") Plain concatenation of selectors results in a logical AND of conditions. For example, consider the following query: $("div.header.highlight") It selects all DIV elements styled using both the class header and class highlight. The + operator the adjacent operator selects sibling elements in the second selector immediately preceded by elements selected by the first selector. Here s an example: // All P immediately preceded by A $("a + p") 21
jQuery Programming
The ~ operator the next operator is similar to + except that it selects sibling elements just preceded by others. Here s an example: // All P preceded by A $("a ~ p") By using the comma, instead, you return the union of elements queried by multiple selectors. In terms of operations, the comma represents a logical OR of selectors. The next example, in fact, picks up elements that are either A or P: // All A and all P $("a, p") Beyond simple operators, you have filters. A filter is a jQuery-specific expression that contains some custom logic to further restrict the selected elements. Predefined Filters
Selectors can be further refined by applying filters on position, content, attributes, and visibility. A filter is a sort of built-in function applied to the wrapped set returned by a basic selector. Table 21-1 lists positional filters in jQuery. TABLE 21-1 Positional Filters
Description
Returns the first DOM element that matches Returns the last DOM element that matches Returns all DOM elements that do not match the specified selector Returns all DOM elements that occupy an even position in a 0-based indexing Returns all DOM elements that occupy an odd position in a 0-based indexing Returns the DOM element in the wrapped set that occupies the specified 0-based position Returns all DOM elements that occupy a position in a 0-based indexing greater than the specified index Returns all DOM elements that occupy a position in a 0-based indexing less than the specified index Returns all DOM elements that are headers, such as H1, H2, and the like Returns all DOM elements that are currently being animated via some functions in the jQuery library
|
|