#1323 closed bug (duplicate)
Namespace Attributes Selector Missing
Reported by: | sosensible | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.1.4 |
Component: | core | Version: | 1.1.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
You can call the attribute correctly like this...
jQuery('form').attr('name:attribute')="true"
but that doesn't return a collection of forms where the condition is true... and if you manually create an array that doesn't work with the jQuery each. The following would be a test case that should work. (Libraries like SPRY are using this technology and it SHOULD be with this release if possible.)
jQuery('form[@name:attribute="true"]').each(function(){});
If another type of selectore or function cared for that it would be fine also... but this is definitely a missing feature in jQuery selectors and selectors are very much what makes jQuery great.
Change History (3)
comment:1 Changed 16 years ago by
comment:2 Changed 16 years ago by
jQuery.fn.coopforms = function() {
return this.filter(function(){
return jQuery(this).attr("coop:manage") == "true";
});
};
Dan and Mike helped me get this simpler. (Was missing the return on the outer level. Return on the inner side of the loop isn't enough!)
comment:3 Changed 16 years ago by
Milestone: | 1.1.3 → 1.1.4 |
---|---|
Priority: | blocker → major |
Resolution: | → duplicate |
Status: | new → closed |
Version: | 1.1.2 → 1.1.3 |
Duplicate of #155.
Here is an example of a work around I found for others who may need one.
jQuery.fn.coopforms = function(){
}
This will wrap your resulting array as a jQuery collection than can be chained like normal jQuery selectors.