Home >>jQuery Tutorial >jQuery image Selector

jQuery image Selector

jQuery image Selector

jQuery image selector in jQuery is used to selects input elements with type=image.

Syntax:
$(":image")
Here is an Example of jQuery :image Selector

<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(":image").css("background-color", "#c0ed1f");
});
</script>
</head>
<body>
<form action="">
Name: <input type="text" name="user"><br>
Password: <input type="password" name="password"><br>
<input type="image" src="https://www.phptpoint.com/images/phptpoint_logo_jpg.jpg?ezimgfmt=rs:190x50/rscb8/ng:webp/ngcb8">
</form>
</body>
</html>

Output:
Name:
Password:

No Sidebar ads