The filter rule of the attribute filter selector is to get the corresponding element through the attribute of the element .
[attribute] Select the element with the secondary attribute
[attribute=value] Select property value as value The elements of
[attribute!=value] The selected property value is not equal to value The elements of
[attribute^=value] Select the property value to value The starting element
[attribute$=value] Select the property value to value The ending element
[attribute*=value] Select a property value that contains value The ending element
[attribute|=value] Select a property that is equal to or prefixed with a given string ( The string is followed by a join character “-”) The elements of
[attribute~=value] Select the element with a given value in the value separated by a space
[attribute1][attribute2][attributeN] Combine attribute selectors into a composite attribute selector , Satisfy multiple conditions . Every time you choose , Narrow down once .
Example
$("div[id]") Select to have this property id The elements of
$("div[title=test]") Select Properties title by "test" Of <div> Elements
$("div[title!=test]") Select Properties title It's not equal to "test" Of <div> The elements of ( Note that there are no attributes title Of <div> Elements will also be selected )
$("div[title^=test]") Select Properties title With "test" At the beginning <div> Elements
$("div[title$=test]") Select a property to "test" The end of the <div> Elements
$("div[title*=test]") Select Properties title contain "test" Of <div> Elements
$("div[title|="en"]") Select Properties title be equal to en Or with en The prefix ( The string is followed by a hyphen ‘-’) The elements of
$("div[title~="uk"]") Select Properties title Values separated by spaces contain strings uk The elements of
$("div[id][title$='test']") Select owned properties id, And properties title With "test" The end of the <div> Elements
from:http://blog.csdn.net/xiaojun1288/article/details/8453571
【 turn 】jQuery More articles on property filter selectors
- jquery Property filter selector
http://www.jb51.net/article/46279.htm $("div[id]").addClass("highlight"); // lookup ...
- Jquery | Basics | Property filter selector
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- jQuery The form object property of the selector filters the selector Demo
Test code : 08- Form object property filter selector .html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ...
- jQuery Property filter selector for
from :http://blog.csdn.net/woshisap/article/details/7341136 stay HTML In the document , The start tag of an element usually contains multiple attributes (attribute), stay jQu ...
- jQuery Form object property filter selector
jQuery Form object property filter selector <div id="p1" attr="p1"> <input type="text" ...
- Dark horse day16 jquery&amp; Property filter selector
The filtering rule of the attribute filter selector is to get the corresponding element through the attribute of the element .[attribute] Usage method : $("div[id]") ; Return value Collection elements explain : Match elements that include given attributes . sample ...
- Jquery | Basics | jQuery Form object property filter selector
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> Use jQuery Form object properties ...
- 009 jquery Filter selector -----------( Form object property filter selector And Form selector )
1. Form object property selector 2. Program <!DOCTYPE html> <html> <head> <meta charset="UTF-8"& ...
- jQuery Simple filter selector
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <!--jQuery Selector details According to the information obtained ...
Random recommendation
- 《PHP Array function 》 note
① in_array() Check if there is a value in the array ; There are two parameters , The first parameter is the value to look for , The second parameter is the array name , The return value is Boolean , Found ture otherwise false; ② array_search Search the array for the given ...
- LeetCode——Gray Code
Description: The gray code is a binary numeral system where two successive values differ in only one ...
- Under the virtual machine Ubuntu No, GUI The graphical interface , resolvent
Let's start with the shortcut keys ,CLI Switch to GUI:Ctrl+Alt+F7: GUI Switch to CLI:Ctrl+Alt+F1. Today, when we toss the virtual machine , open Ubuntu After the display is the command line interface , Press the shortcut key without converting to the graphical interface , But all the time ...
- Bar Chart of Frequency of modals in different sections of the Brown Corpus
Natural Language Processing with Python Chapter 4.8 colors = 'rgbcmyk' # red, green, blue, cyan, mag ...
- On how to use SVN Some suggestions for
SVN It's one of the main ways to manage source code , Conflicts often arise when multiple people edit the same project at the same time , This paper mainly aims at Asp.net Used in project development SVN Make a suggestion . 1. Ignore asp.net Non source files in the project .VS Directory is vis ...
- JS in [object object] How to take the value
error message : It was meant to show JSON Object's As a result, the console printed [object object] There needs to be a simple transformation , as follows : var jsonData = JSON.stringify(data);// Turn into ...
- C# Design patterns (0)—— Design principles
Design principles The fundamental reason for using design patterns is to adapt to change , Improve code reuse rate , Make the software more maintainable and extensible . When it comes to design , We need to follow the following principles : Principle of single responsibility . Opening and closing principle . Leech's substitution principle . The principle of Dependence Inversion . Interface isolation principle ...
- Use redis-dump Batch import and export data
Sometimes you need to redis Import and export the data of , have access to redis-dump This tool . One . install RVM redis-dump Tools depend on 2.2 Previous versions of ruby, and centos In the environment yu ...
- 2017" Baidu star " Programming Competition - The rematch 01,03,05
Arithmetic of Bomb Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Other ...
- win10 Input method five stroke settings
win10 settings inputApp 1● Install five pens qq ignore / ign ɔ: 2● Operation steps 3● Five stroke settings