:image (since jQuery 1.0) selects every <input type="image"> — a graphical form submit control that looks like a picture. Official docs state it is equivalent to [type="image"]. It does not match <img> tags. Always prefer $("input:image") over bare $(":image").
Remember
$("input:image") // all image inputs
$("form input:image") // image inputs inside a form
$("input[type=image]") // equivalent attribute form
$("img") // content pictures — different!
// Avoid on large pages:
$(":image") // implies *:image
Prefix with input, scope to a form, then style, count, or bind click handlers.
Write $("input:image") — never bare $(":image") on large pages.
Scope to a form: $("#pay input:image").
Remember: this is a submit control, not an <img> element.
Style or bind events on the matches (official demo uses .css()).
For hot paths, prefer input[type="image"] so the browser can optimize.
Piece
Required?
Role
Selector string
Yes
:image filter (best with an input prefix)
Form / context
Optional
Avoids image inputs in unrelated widgets
src / alt
HTML attrs
Picture and accessible label for the control
Return value
—
jQuery collection of matching image inputs (may be empty)
Pseudocode
Pseudocode
matches = []
for each element in search context:
if element.tag is input
and element.type is "image":
matches.add(element)
return matches
// Does NOT match <img> elements
Reference
Cheat Sheet
Keep these facts handy while selecting image inputs.
Topic
Detail
Syntax
$("input:image")
Since
jQuery 1.0 · jQuery extension
Equivalent
$("[type=image]")
Matches
input type="image" only
vs $("img")
Different — content images vs form control
vs :submit
Text/submit buttons — separate type
Role
Graphical form submit
Native CSS
Use [type="image"] for speed
Try it
Live Preview
Run different selectors against a small sample form and see how many image inputs match.
Sample markup mirrors the official jQuery form demo (text, checkbox, button, image input) plus an img and submit for contrast.
Result
$("input:image")
matched: 1
/* image input only — img tag ignored */
Code
jQuery Examples
Short, copy-ready snippets. Open DevTools Console with jQuery loaded, or use Try It Yourself for a live editor.
Example 1 — Official Demo: input:image
Style image inputs and print the match count (jQuery API example).
jQuery
var input = $("input:image").css({
background: "yellow",
border: "3px red solid"
});
$("#count").text("For this type jQuery found " + input.length + ".");
For this type jQuery found 1.
Image input highlighted
Text / checkbox / button → unchanged
How It Works
Select.input:image finds every image-type input.
Filter. Only type="image" matches — other inputs are ignored.
Style. Official demo applies a yellow background and red border.
Report..length is how many image inputs were found.
Example 2 — Equivalence: :image vs [type=image]
Official docs — both forms select the same elements.
jQuery
var a = $("input:image").length;
var b = $("input[type=image]").length;
console.log("input:image →", a);
console.log("[type=image] →", b);
console.log("same set?", a === b);
Click the image input →
Clicked image input: Go
Other buttons → no handler
How It Works
Prevent submit. Stop the form so the page does not navigate.
Scope.input:image binds only to graphical submit controls.
Click. The handler runs when the user activates that control.
Label.alt (or name) identifies which image input fired.
Example 5 — Native Performance: input[type="image"]
Official tip — use the attribute selector so modern browsers can optimize.
jQuery
var $imgs = $("input[type='image']");
$("#out").text("Found " + $imgs.length + " image input(s) via [type=image]");
// Pure DOM (no jQuery pseudo-class):
// document.querySelectorAll("input[type='image']")
Found 1 image input(s) via [type=image]
Works in querySelectorAll — no :image extension needed
How It Works
Standard CSS.[type="image"] is valid in native selectors.
Same matches. You still get every image input.
Engine boost. jQuery can hand the query to querySelectorAll.
When to switch. Prefer this form on large pages or hot update paths.
Edge Cases & Pitfalls
Check these before relying on :image in real forms.
slow
Bare $(":image") scans everything
It implies *:image. Prefer $("input:image") or a form-scoped query.
non-std
Not valid in querySelectorAll
:image is a jQuery extension. Use input[type="image"] for native CSS queries.
confuse
:image ≠ $("img")
Content pictures use the img element selector. :image is only the form control.
a11y
Always set alt
Image inputs need a meaningful alt (like a submit label) for screen readers.
Compatibility
Browser Support
The :image pseudo-class is a jQuery extension and has worked since jQuery 1.0. The equivalent input[type="image"] attribute selector is standard CSS and runs in native querySelectorAll.
✓ jQuery 1.0+ · extension
jQuery :image Selector
Supported across jQuery 1.x, 2.x, and 3.x wherever your jQuery build runs. Prefer input:image; use input[type="image"] for native speed.
100%jQuery + native attr
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
:imageUniversal
Bottom line: Safe everywhere jQuery runs. Prefer $("input:image"); use [type="image"] when performance matters. Do not confuse with $("img").
Analysis
Performance Notes
Approach
Cost
Best for
$("input[type=\"image\"]")
Fastest
Modern browsers / hot paths
$("input:image")
Cheap
Typical tutorials and small forms
$("#form input:image")
Cheaper
Multi-form pages
$(":image")
Slower
Avoid — universal scan
Official jQuery docs note that because :image is not CSS, it cannot use the querySelectorAll boost. Prefer [type="image"] when the page is large or you re-query often.
Remember
Key Takeaways
Role: select every input type="image" (graphical submit) in scope.
Prefix: use $("input:image"), not bare $(":image").
Not img: content pictures use $("img") — a different selector.
Speed: prefer [type="image"] when native performance matters.
One line:$("input:image") finds graphical submit controls — not <img> tags — and [type="image"] is faster on large pages.
Frequently Asked Questions
:image selects every input whose type is image — graphical submit buttons rendered as pictures. $("input:image") finds all image inputs in the search context. Available since jQuery 1.0.
No. :image matches input[type="image"] only — form submit controls. To select picture elements in content, use the element selector $("img") instead.
Yes. Official jQuery docs state that :image is equivalent to [type="image"]. For native querySelectorAll performance in modern browsers, prefer input[type="image"] over the :image pseudo-class.
Prefer $("input:image"). Bare $(':image') implies the universal selector and scans as $('*:image'), which is slower on large pages. Official docs recommend prefixing with input or scoping to a form.
:image matches only input[type="image"]. :submit matches submit buttons (input or button). :button matches button tags and input[type="button"]. An image input is its own control type.
No. It is a jQuery extension (not part of the CSS specification), so queries using :image cannot use the native querySelectorAll boost. Use [type="image"] when performance matters.