Skip to content
Related Articles

Related Articles

jQuery :image Selector

Improve Article
Save Article
  • Last Updated : 14 Nov, 2022
Improve Article
Save Article

The jQuery :image selector is used to select the input elements with type equal to image. 

Syntax: 

$(":image")

Parameter: :enabled selector: It is used for selecting HTML input elements for changing the its properties, e.g background-color, etc. 

Example 1: 

HTML




<!DOCTYPE html>
<html>
<head>
  <title>:image Selector</title>
  <script src=
  </script>
  <script>
    $(document).ready(function () {
      $(":image").css("height", "50px");
    });
  </script>
</head>
<body>
  <center>
    <form action="#">
      <h1>Welcome to GeeksforGeeks!</h1>
      Image
      <input type="image" src="logo.png"
        width="31" height="30">
    </form>
  </center>
</body>
</html>


Output: 

It changes the height of the image:

  

Example 2: 

HTML




<!DOCTYPE html>
<html>
<head>
  <title>:image Selector</title>
  <script src=
  </script>
  <script>
    $(document).ready(function () {
      $(":image").css("width", "150px");
    });
  </script>
</head>
<body>
  <center>
    <div style="background-color: #ffff94;">
      <h1>Welcome to GeeksforGeeks!.</h1>
      Image
      <input type="image" src="logo.png"
        width="31" height="30">
    </div>
  </center>
</body>
</html>


Output:

 


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!