Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
346ceacc
Commit
346ceacc
authored
Aug 31, 2007
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for a new :header psuedo-selector (only selects H1-H6 elements).
parent
fbd2b066
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
index.html
build/test/index.html
+1
-1
selector.js
src/selector/selector.js
+4
-1
selectorTest.js
src/selector/selectorTest.js
+3
-1
No files found.
build/test/index.html
View file @
346ceacc
...
...
@@ -14,7 +14,7 @@
</head>
<body
id=
"body"
>
<h1>
jQuery Test Suite
</h1>
<h1
id=
"header"
>
jQuery Test Suite
</h1>
<h2
id=
"banner"
></h2>
<h2
id=
"userAgent"
></h2>
...
...
src/selector/selector.js
View file @
346ceacc
...
...
@@ -56,7 +56,10 @@ jQuery.extend({
input
:
"/input|select|textarea|button/i.test(a.nodeName)"
,
// :has()
has
:
"jQuery.find(m[3],a).length"
has
:
"jQuery.find(m[3],a).length"
,
// :header
header
:
"/h
\\
d/i.test(a.nodeName)"
},
// DEPRECATED
"["
:
"jQuery.find(m[2],a).length"
...
...
src/selector/selectorTest.js
View file @
346ceacc
...
...
@@ -163,7 +163,7 @@ test("attributes", function() {
});
test
(
"pseudo (:) selectors"
,
function
()
{
expect
(
3
0
);
expect
(
3
1
);
t
(
"First Child"
,
"p:first-child"
,
[
"firstp"
,
"sndp"
]
);
t
(
"Last Child"
,
"p:last-child"
,
[
"sap"
]
);
t
(
"Only Child"
,
"a:only-child"
,
[
"simon1"
,
"anchor1"
,
"yahoo"
,
"anchor2"
]
);
...
...
@@ -196,6 +196,8 @@ test("pseudo (:) selectors", function() {
t
(
"Form element :radio:checked"
,
":radio:checked"
,
[
"radio2"
]
);
t
(
"Form element :checkbox:checked"
,
":checkbox:checked"
,
[
"check1"
]
);
t
(
"Form element :checkbox:checked, :radio:checked"
,
":checkbox:checked, :radio:checked"
,
[
"check1"
,
"radio2"
]
);
t
(
"Headers"
,
":header"
,
[
"header"
,
"banner"
,
"userAgent"
]
);
});
test
(
"basic xpath"
,
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment