:imageS2C Home « Selectors « :image

Form image selector.

Shorthand version $(':image')


The :image selector, selects all elements of type image.

Being a jQuery extension the :image pseudo selector is not part of any current CSS specification. Therefore :image cannot take advantage of the performance boost provided by the native DOM querySelectorAll() method.

The same results can be achieved with valid CSS using $('[type=image]'), without the hit to performance.

If this selector is not preceded by another selector, the universal selector ("*") is implied and so the whole DOM will be searched. Use another selector as in the example below to narrow the search and improve performance.


Signature Description
jQuery(':image')Form image pseudo-class match





:image ExampleTop

Selects all elements of type image.

In the example below we apply a red border to 'image' elements within the form.

  $('.ourform').submit(function () { return false; }); // disable submit 
  $('#btn2').on('click', function() {
    $('#main form input:image').css('border', '2px solid red');

Pie Survey     




Which pie do you prefer?:

Select a pie shape: 


Press the button below to action the above code: