The multiple attribute selector (since jQuery 1.0) matches elements that pass every chained attribute filter — [filter1][filter2][filterN]. It is standard CSS with AND logic.
Remember
// Official pattern — has id AND name ends with "man"
$("input[id][name$='man']");
// Mix operators
$("a[href^='https'][target='_blank']");
$("input[type='text'][required]");
// Not OR — use a comma for OR
$("input[id], input[name$='man']");
Chain attribute brackets after an optional tag, then act on the match.
Start with a tag if helpful: input, a, button.
Add the first filter: [id] or [type='text'].
Chain more filters with no space: [name$='man'].
Every filter must pass — think AND.
Chain methods — .val(), .text(), .addClass().
Piece
Required?
Role
Tag
Optional
Limits which elements are tested
First [filter]
Yes
First attribute condition
More [filter]s
Yes (for “multiple”)
Extra AND conditions
Pseudocode
Pseudocode
for each element matching the tag (e.g. input):
if it fails filter1 → skip
if it fails filter2 → skip
…
if it passes every filter:
include it in the result
chained brackets = AND
comma-separated selectors = OR
Reference
Cheat Sheet
Keep these facts handy while chaining attribute filters.
Topic
Detail
Syntax
$("[f1][f2][fN]")
Since
jQuery 1.0
Logic
AND (all filters must match)
CSS?
Yes — standard CSS
Mix operators
=^=$=*= presence
vs comma list
AND vs OR
Official demo
$("input[id][name$='man']")
Try it
Live Preview
Run the official AND filter, compare with a single filter, or count matches.
Sample inputs below. AND needs both an id and a name ending in man.
Result
Ready — pick an action and click Run.
Code
jQuery Examples
Short, copy-ready snippets. Use Try It Yourself for a live editor.
Example 1 — Official input[id][name$='man']
Set a value only when both filters pass (official demo idea, CSS-free).
Chain. One selector evaluates both filters together.
Filter. Two .filter() calls narrow step by step.
Same. Counts match for the same markup.
Prefer. Chained brackets are usually clearer for static AND rules.
Edge Cases & Pitfalls
Check these when a chained attribute selector returns nothing.
logic
AND is strict
Failing any one filter excludes the element. Do not expect OR from adjacent brackets.
space
No space between brackets
[id][name$='man'] chains filters. A space can change the meaning to a descendant search.
case
Value compares are case-sensitive
[name$='man'] does not match name="BatMan" when the casing differs.
quotes
Quote attribute values
Prefer [name$='man'] or double quotes so special characters in values stay safe.
Compatibility
Browser Support
Chained attribute selectors are standard CSS. jQuery has supported them since 1.0. Modern browsers can run them through native querySelectorAll.
✓ Stable · jQuery 1.0+
jQuery [f1][f2]
Works in every browser that runs your loaded jQuery version. Behavior matches CSS attribute filter chaining.
100%CSS selector
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
Multiple attrUniversal
Bottom line: Safe for everyday UI. Chain filters for AND; use a comma-separated list when you need OR.
Analysis
Performance Notes
Approach
Cost
Best for
Tagged chain $("input[id][name$='man']")
Cheap
Forms and local widgets
Bare chain $("[id][name$='man']")
Cheap–moderate
Page-wide attribute AND
Double .filter()
Moderate
Dynamic narrowing on an existing set
Prefer a tag plus chained filters so the browser can narrow early. Chained CSS often beats multiple filter passes.
Remember
Key Takeaways
Role: match elements that pass every chained attribute filter.
Logic: adjacent brackets mean AND, not OR.
Mix: combine presence, =, ^=, $=, and *=.
Scope: prefer a tag like input[…] over a bare page-wide chain.
One line:[a][b] means both attribute filters must match — use a comma list when you need OR.
Frequently Asked Questions
It selects elements that satisfy every chained attribute filter — all conditions must pass. For example, [id][name$="man"] matches only elements that have an id attribute AND whose name value ends with man.
Yes. Writing [filter1][filter2][filter3] means the element must match filter1 AND filter2 AND filter3. There is no OR between chained brackets — use a comma-separated multiple selector for OR.
Yes. You can combine presence ([id]), exact match ([type="text"]), prefix ([href^="https"]), suffix ([name$="man"]), and contains ([class*="btn"]) in one selector string.
Yes. Chained attribute selectors are standard CSS and have worked in jQuery since 1.0. Modern browsers can run them through native querySelectorAll.
Chaining in the selector string ([a][b]) evaluates all filters in one query — often clearer. $("input").filter("[name$=man]").filter("[id]") achieves similar AND narrowing but as separate passes.
Each bracket narrows the result. A single [name$="man"] may match many inputs; adding [id] restricts to elements that also have an id — more specific, fewer false positives.