- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
jQuery :image Selector
The :image selector in jQuery is used to select all input elements with type=”image”.
Syntax
The syntax is as follows −
$(":image")
Example
Let us now see an example to implement the :image() selector −
<!DOCTYPE html> <html> <head> <style> .demo { background-color: gray; border: 2px yellow dashed; } </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> $(document).ready(function(){ $(":image").addClass("demo"); }); </script> </head> <body> <h2>Login</h2> <form action=""> Student Name: <input type="text" name="sname"><br> Student ID: <input type="text" name="sid"><br><br> Learn MySQL: <input type="image" src="https://www.tutorialspoint.com/images/MySQL.png" width="31" height="30"> </form> </body> </html>
Output
This will produce the following output −
Advertisements