The attribute equals selector matches elements whose attribute value is exactly equal to a given string — character for character. Available since jQuery 1.0 (standard CSS).
Name the attribute, set the exact value, then query — quote values that contain spaces.
Choose the attribute (value, type, name, …).
Write $("[attr='exact']") — or with a tag: $("input[value='Hot Fuzz']").
Quote values with spaces or special characters.
Remember: the whole value must match — not a prefix, suffix, or substring.
Piece
Required?
Role
attribute
Yes
Attribute name to test
value
Yes
Exact string the attribute must equal
Quotes around value
Recommended
Required when the value has spaces
Pseudocode
Pseudocode
attrName = given attribute
target = given value
matches = empty list
for each element with attrName:
v = element.getAttribute(attrName)
if v == target: // exact, case-sensitive
add element
return jQuery(matches)
Reference
Cheat Sheet
Keep these facts handy while matching exact attribute values.
Topic
Detail
Syntax
$("[attr='value']")
Matches
Entire attribute value equals the string
Classic use
$("input[value='Hot Fuzz']")
Common form
$("input[type='submit']")
Case
Sensitive in HTML attribute values
vs *= / !=
Substring / exclude exact value
Since
jQuery 1.0 (standard CSS)
Try it
Live Preview
Run equals / contains / type selectors against sample inputs and see which values match.
Sample markup mirrors the official jQuery value='Hot Fuzz' demo.
Result
$("input[value='Hot Fuzz']")
matched: 1
values: Hot Fuzz
/* exact value only */
Code
jQuery Examples
Short, copy-ready snippets. Open a browser with jQuery loaded, or use Try It Yourself for a live editor.
Example 1 — Official Demo: input[value="Hot Fuzz"]
Find the input with that exact value, then label its next sibling span.
Target by name.[name='email'] finds that exact field name.
Read the value..val() returns the current input contents.
One field. Exact equality keeps sibling fields with other names out.
Practical use. Hook validation or submit logic to a known field name.
Example 5 — Case Sensitivity
Attribute value matching is case-sensitive — casing must align.
jQuery
console.log("Hot Fuzz:", $("input[value='Hot Fuzz']").length);
console.log("hot fuzz:", $("input[value='hot fuzz']").length);
// lowercase does not match value="Hot Fuzz"
Hot Fuzz: 1
hot fuzz: 1
Each query matches only its own casing
How It Works
Same letters, different case. Selectors compare the string as written.
Title case query. Matches value="Hot Fuzz" only.
Lowercase query. Matches value="hot fuzz" only.
Habit. Keep attribute values and selectors in a consistent casing style.
Edge Cases & Pitfalls
Check these before relying on = in real projects.
exact
Extra characters break the match
value="Hot Fuzz 2" does not match [value="Hot Fuzz"]. Use *=, ^=, or $= for partial matches.
case
Case-sensitive values
In HTML, [value="Hot Fuzz"] does not match value="hot fuzz". Align casing in markup and selectors.
quotes
Quote values with spaces
Write [value='Hot Fuzz'], not bare tokens. Spaces need quotes in the selector string.
presence
Missing attribute never matches
An element without the attribute is skipped. To select “has attribute, any value,” use [attr].
Compatibility
Browser Support
The attribute equals selector [attr="value"] is standard CSS and has worked in jQuery since 1.0. Modern browsers implement it in native querySelectorAll.
✓ CSS · jQuery 1.0+
jQuery [name="value"]
Supported in all modern browsers. Native: document.querySelectorAll("input[value='Hot Fuzz']"). Exact, case-sensitive value matching.
100%Standard 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
= combinatorUniversal
Bottom line: Safe everywhere jQuery runs. Prefer exact = when the full value is known; switch to *= / ^= / $= for partial matches.
Analysis
Performance Notes
Approach
Cost
Best for
$("input[type='submit']")
Native-friendly CSS
Known exact attributes
$("input[value='Hot Fuzz']")
Native-friendly CSS
Exact value lookups
$("[value*='Hot']")
Wider / looser
Only when you need a substring
Exact attribute selectors are standard CSS, so jQuery can often use the browser engine. Narrow with a tag or a container on large pages.
Remember
Key Takeaways
Role: match when the attribute value equals a string exactly.
Classic use:$("input[value='Hot Fuzz']") from the official demo.
Not *=: exact equality ≠ substring match.
Quote spaces: use [value='Hot Fuzz'], not bare tokens.
One line: use [attr="value"] when you know the full attribute string and need an exact match.
Frequently Asked Questions
It selects elements whose named attribute value is exactly equal to the given string — character for character. For example, [value="Hot Fuzz"] matches only value="Hot Fuzz", not value="Hot Fuzz 2" or value="hot fuzz".
Yes. In HTML documents, attribute selector matching is generally case-sensitive for values. value="hot fuzz" does not match [value="Hot Fuzz"].
[attr="pdf"] matches only when the entire value is exactly pdf. [attr*="pdf"] matches pdf anywhere. [attr^="pdf"] matches values starting with pdf. [attr$="pdf"] matches values ending with pdf.
Yes. The attribute equals selector is standard CSS and has worked in jQuery since 1.0, with native querySelectorAll support in modern browsers.
Yes. input[type="submit"] is one of the most common exact-match patterns — it targets inputs whose type attribute is exactly submit.
No. The entire attribute value must match exactly. Use [value*="Hot Fuzz"] if you need substring matching anywhere in the value.