jQuery | :file Selector
The :file Selector is used to selects the input element having file field.(type==file)
Syntax:
$(":file")
Example: Input element with type = file.
<!DOCTYPE html> <html> <head> <script src= </script> <script> $(document).ready(function() { $(":file").css("background-color", "dodgerblue"); }); </script> </head> <body> <center> <h1 style="color:green;">GeeksForGeeks </h1> <h2>jQuery :file Selector</h2> <form action=""> Name: <input type="text" name="user"> <br> Password: <input type="password" name="password"> <br> File: <input type="file" name="myfile"> </form> </center> </body> </html> |
chevron_right
filter_none
Output:

Supported Browsers: The browser supported by jQuery :file Selector are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari
Recommended Posts:
- jQuery | :even Selector
- jQuery | :gt() Selector
- jQuery | :not() Selector
- jQuery | :first Selector
- jQuery | :odd Selector
- jQuery | * Selector
- jQuery | #id Selector
- jQuery | :lt() Selector
- jQuery | :contains() Selector
- jQuery | :last Selector
- jQuery | :has() Selector with example
- jQuery | :radio Selector
- jQuery | :input Selector
- jQuery | :checkbox Selector
- jQuery | :empty Selector
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



