The :image selector matches every input[type="image"] element — graphical submit buttons in forms. jQuery extension since 1.0; equivalent to [type="image"]; does not match <img> tags.
01
Syntax
input:image
02
Type
image input
03
Official
Style & count
04
[type=]
Equivalent
05
Not img
Use $("img")
06
Scope
Form prefix
Fundamentals
Introduction
HTML forms can use graphical submit buttons — <input type="image" src="…" alt="Submit"> — instead of plain text buttons. When you need to style every image submit control or attach click handlers, jQuery’s :image pseudo-class gathers them in one expression.
jQuery has supported :image since version 1.0. Official documentation describes it as selecting all elements of type image and states it is equivalent to [type="image"]. Because it is a jQuery extension, prefer input[type="image"] when you need native querySelectorAll speed in modern browsers.
<img src="photo.jpg"> + input:image → no match (use $("img")).
<button type="submit"> + input:image → no match.
💡
Beginner Tip
The name :image sounds like picture tags, but it only targets image submit inputs. Content images use the img element selector.
Foundation
📝 Syntax
Official jQuery API form (since 1.0):
jQuery
jQuery( ":image" )
// recommended — prefix with input:
$( "input:image" )
// scoped to a form:
$( "#searchForm input:image" )
// CSS-equivalent (native querySelectorAll):
$( "input[type='image']" )
Parameters
None — :image takes no arguments. It always means type="image" on an input element.
Return value
A jQuery object containing every matched image input in document order within the search scope.
Empty collection when no image inputs exist.
Official jQuery API example
jQuery
var input = $( "input:image" ).css({
background: "yellow",
border: "3px red solid"
});
$( "div" ).text( "For this type jQuery found " + input.length + "." );
Cheat Sheet
⚡ Quick Reference
Goal
Selector
Matches
All image inputs
$("input:image")
input[type=image]
Native CSS
input[type="image"]
Same nodes
Picture elements
$("img")
Not :image
Form scope
$("#form input:image")
One form
Text submit
input:submit
Different type
Compare
📋 :image vs img, :button, and [type="image"]
Form submit graphics vs content pictures vs other control types.
:image
input:image
Submit input
img
$("img")
Content pics
[type=]
[type="image"]
Native CSS
:button
input:button
Plain button
Hands-On
Examples Gallery
Example 1 follows the official jQuery input:image demo. Examples 2–5 cover attribute equivalence, the img vs input distinction, scoped form queries, and click coordinates.
📚 Official jQuery Demo
Style image inputs and report how many were found.
Example 1 — Official Demo: input:image
Official jQuery demo — yellow background and red border on image inputs; count displayed in a div.
jQuery
var input = $( "input:image" ).css({
background: "yellow",
border: "3px red solid"
});
$( "div" ).text( "For this type jQuery found " + input.length + "." );
Click image submit → logs pageX/pageY coordinates
Form also submits name.x and name.y values server-side
How It Works
Unlike plain submit buttons, image inputs behave like clickable maps — useful for image-map-style forms in legacy UIs.
Applications
🚀 Common Use Cases
Form styling — highlight all input:image controls as in the official demo.
Multi-form pages — scope with $("#formId input:image").
Accessibility — verify every image input has an alt attribute.
Legacy UIs — image-map submit buttons with coordinate data.
Validation — count image submits before enabling a wizard step.
Performance — prefer input[type="image"] for native selectors.
🧠 How jQuery Evaluates :image
1
Build candidate set
Evaluate prefix — input:image or scoped form selector.
Query
2
Check type attribute
Keep inputs where type equals image — same rule as [type="image"].
Filter
3
Preserve order
Return matches in document order within the search context.
Sort
4
✓
Chain methods
Apply .css(), .on("click"), or read .length.
Important
📝 Notes
Available since jQuery 1.0 — jQuery extension, not bare CSS pseudo-class.
Equivalent to [type="image"] — official jQuery documentation.
Matches input[type="image"] only — not <img> elements.
Prefer input:image over bare $(":image") (implies *:image).
Image inputs submit forms like submit buttons, plus optional x/y coordinates.
Always provide meaningful alt text for accessibility.
Compatibility
Browser Support
The :image pseudo-class is a jQuery extension and works in jQuery 1.0+. input[type="image"] controls are supported in all modern browsers. For native selector speed, use the attribute form input[type="image"].
✓ jQuery 1.0+ · extension
jQuery :image Selector
Form image submit inputs — not content img tags.
100%jQuery + HTML
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: Use input:image or input[type=image] scoped to your form.
Wrap Up
Conclusion
The :image selector matches every <input type="image"> submit control. The official demo styles them with a yellow background and red border, then reports how many were found.
Remember it does not select <img> tags, prefix with input, and prefer input[type="image"] when you need native CSS selector performance.
Prevent default submit when demoing click handlers
❌ Don’t
Expect :image to match <img> tags
Use bare $(":image") on large documents
Confuse :image with :button or :submit
Forget image inputs submit the form on click
Use :image in native CSS stylesheets — jQuery-only
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about :image
Input type image — not img tags.
5
Core concepts
📷01
:image
type=image
API
[type]02
Equivalent
Native CSS
Rule
img03
Not img
Different tag
Tip
demo04
Official
input:image
Demo
form05
Scope
#form prefix
Perf
❓ Frequently Asked Questions
:image selects every input element whose type attribute 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 — equivalent to $("*:image") — which scans every element type. Official docs recommend prefixing with input or scoping to a form.
No. It is a jQuery extension since version 1.0. Native querySelectorAll cannot run :image directly. Use input[type="image"] for standard CSS attribute matching.
:image matches only input[type="image"]. :button matches button tags and input[type="button"]. :submit matches input[type="submit"] and button[type="submit"]. An image input is its own control type.
Did you know?
When a user clicks an input[type="image"], the browser submits the form with extra fields — name.x and name.y — recording where they clicked on the graphic. That made image inputs popular for server-side image maps before client-side canvas apps became common.