aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2006-12-19 18:52:45 +0000
committerJörn Zaefferer <joern.zaefferer@gmail.com>2006-12-19 18:52:45 +0000
commit42785b1c1dbdb51e798de90720a164731f495e44 (patch)
tree455fdb133d275eb8a112e75c0f3d58e65b92fcc4 /src
parent0e540ec1b170c11cab11045b4965a927cb44ee34 (diff)
downloadjquery-42785b1c1dbdb51e798de90720a164731f495e44.tar.gz
jquery-42785b1c1dbdb51e798de90720a164731f495e44.zip
Diffstat (limited to 'src')
-rw-r--r--src/jquery/coreTest.js6
-rw-r--r--src/jquery/jquery.js5
2 files changed, 8 insertions, 3 deletions
diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js
index 25fd4dd82..7dd7a16bb 100644
--- a/src/jquery/coreTest.js
+++ b/src/jquery/coreTest.js
@@ -379,7 +379,7 @@ test("expressions - child and adjacent", function() {
});
test("expressions - attributes", function() {
- expect(16);
+ expect(19);
t( "Attribute Exists", "a[@title]", ["google"] );
t( "Attribute Exists", "*[@title]", ["google"] );
t( "Attribute Exists", "[@title]", ["google"] );
@@ -395,6 +395,10 @@ test("expressions - attributes", function() {
t( "Attribute Ends With", "a[@href $= 'org/']", ["mark"] );
t( "Attribute Contains", "a[@href *= 'google']", ["google","groups"] );
+ t("Select options via [@selected]", "#select1 option[@selected]", ["option1a"] );
+ t("Select options via [@selected]", "#select2 option[@selected]", ["option2d"] );
+ t("Select options via [@selected]", "#select3 option[@selected]", ["option3b", "option3c"] );
+
t( "Grouped Form Elements", "input[@name='foo[bar]']", ["hidden2"] );
t( ":not() Existing attribute", "select:not([@multiple])", ["select1", "select2"]);
diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js
index d3ed8c6ee..8cffb8e87 100644
--- a/src/jquery/jquery.js
+++ b/src/jquery/jquery.js
@@ -1418,7 +1418,7 @@ jQuery.extend({
enabled: "!a.disabled",
disabled: "a.disabled",
checked: "a.checked",
- selected: "a.selected || jQuery.attr(a, 'selected')",
+ selected: "a.selected",
// Form elements
text: "a.type=='text'",
@@ -1570,7 +1570,8 @@ jQuery.extend({
value: "value",
disabled: "disabled",
checked: "checked",
- readonly: "readOnly"
+ readonly: "readOnly",
+ selected: "selected"
};
// IE actually uses filters for opacity ... elem is actually elem.style