Skip to content
Permalink
Browse files

Added support for a new :header psuedo-selector (only selects H1-H6 e…

…lements).
  • Loading branch information
jeresig committed Aug 31, 2007
1 parent fbd2b06 commit 346ceacce3fb6f83701d742ce0835d4db0ba98aa
Showing with 8 additions and 3 deletions.
  1. +1 −1 build/test/index.html
  2. +4 −1 src/selector/selector.js
  3. +3 −1 src/selector/selectorTest.js
@@ -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>

@@ -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"
@@ -163,7 +163,7 @@ test("attributes", function() {
});

test("pseudo (:) selectors", function() {
expect(30);
expect(31);
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() {

0 comments on commit 346ceac

Please sign in to comment.
You can’t perform that action at this time.