The :file selector selects input elements with type=file.
$(":file")
Select <input> elements with type="file":
$(":file")
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> $(document).ready(function(){ $(":file").css("background-color", "red"); });//w w w. j a va 2 s .c om </script> </head> <body> <form action=""> Name: <input type="text" name="user"><br> File: <input type="file" name="myfile"> </form> </body> </html>