Remove the Chrome's "No file chosen option" from a file input using JavaScript Last Updated : 11 Jul, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report The task is to remove the "no file chosen" value from the empty input element in chrome. We are going to achieve that task with the help of JavaScript. Approach 1: Remove the tooltip value('No file chosen'). Use .attr() method to set the value of title attribute to empty. Example 1: This example removes the tooltip value. html <!DOCTYPE HTML> <html> <head> <title> Remove the “No file chosen” from a file input in Chrome? </title> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"> </script> </head> <body style="text-align:center;" id="body"> <h1 style="color:green;"> GeeksForGeeks </h1> <p id="GFG_UP" style="font-size: 15px; font-weight: bold;"> </p> <div> <input type='file' /> </div> <br> <button onclick="gfg_Run()"> Remove tooltip </button> <p id="GFG_DOWN" style="color:green; font-size: 20px; font-weight: bold;"> </p> <script> var el_up = document.getElementById("GFG_UP"); var el_down = document.getElementById("GFG_DOWN"); el_up.innerHTML = "Click on the button to remove the tooltip value '" + "No file is chosen.'"; function gfg_Run() { $('input').attr('title', ''); el_down.innerHTML = "Tooltip value has been removed."; } </script> </body> </html> Output: Before clicking on the button: After clicking on the button: Approach 2: Remove the value('No file chosen'). Use .addClass() method to add the class which removes the value "No file chosen". Example 2: This example remove the value "No file chosen" from input element. html <!DOCTYPE HTML> <html> <head> <title> Remove the “No file chosen” from a file input in Chrome? </title> <style> .removeValue { color: transparent; } </style> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"> </script> </head> <body style="text-align:center;" id="body"> <h1 style="color:green;"> GeeksForGeeks </h1> <p id="GFG_UP" style="font-size: 15px; font-weight: bold;"> </p> <div> <input type="file" /> </div> <br> <button onclick="gfg_Run()"> Remove value </button> <p id="GFG_DOWN" style="color:green; font-size: 20px; font-weight: bold;"> </p> <script> var el_up = document.getElementById("GFG_UP"); var el_down = document.getElementById("GFG_DOWN"); el_up.innerHTML = "Click on the button to remove the value '" + "No file is chosen.'"; function gfg_Run() { $('input').addClass('removeValue'); el_down.innerHTML = "Value has been removed."; } </script> </body> </html> Output: Before clicking on the button: After clicking on the button: Comment More infoAdvertise with us Next Article How to trim a file extension from string using JavaScript ? P PranchalKatiyar Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Misc Similar Reads How to check input file is empty or not using JavaScript/jQuery ? Given an HTML document containing an input element, the task is to check whether an input element is empty or not with the help of JavaScript. These are the two approaches to check input file is empty or not using JavaScript/jQuery: Table of Content Using element.files.length property in JavaScript 2 min read How to remove âdisabledâ attribute from HTML input element using JavaScript ? In HTML, we use input elements for user input. The 'disabled' property helps prevent interaction with these elements. For example, if we only want users over 18 to input their Adhar card numbers, we can use JavaScript to remove the 'disabled' attribute when the user enters an age greater than 18. Th 2 min read How to trim a file extension from string using JavaScript ? Given a fileName in string format and the task is to trim the file extension from the string using JavaScript. replace() method: This method searches a string for a defined value or a regular expression, and returns a new string with the replaced defined value. Syntax: string.replace(searchVal, newv 4 min read How to detect when cancel is clicked on file input using JavaScript ? This article describes the method to handle a situation when the user tries to input a file and later fails to upload the file. It gives the status to the user that the file is not uploaded. This may be useful in situations when an important file needs to be submitted or the application requires the 3 min read How to Disable Specific Readio Button Option using JavaScript? In this article, we will disable a specific radio button using JavaScript. Disabling specific radio button options using JavaScript involves targeting the specific option and then set its disabled property to true. This can be done by selecting the radio button option and modifying its disabled prop 2 min read How to Check Mentioned File Exists or not using JavaScript/jQuery? Sometimes we want to upload a file through the path of the file, but a few times the file does not exist. In that case, we have to respond to users the given path does not find any file or does not exist in the mentioned file. Below are the approaches to check if mentioned file exists or not using J 3 min read Like