jQuery – :image Selector

The jQuery image selector selects all elements of type image. :image is equivalent to [type=”image”]

Source Code

<!DOCTYPE html>
<html>
<head>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>

<input type="image" /><br>
Text : <input type="text" />
<br/>
<button>Click Here</button>

  
<script>
jQuery("button").click(function () {
	jQuery("input:image").css({border:"3px #1E8CBE solid"});
});
</script>
</body>
</html>

Demo

Following example finds all image inputs and create a border around them.


Text :

,

No comments yet.

Leave a Reply