Javascript examples for DOM HTML Element:Input FileUpload
Input FileUpload accept Property - Display the accepted content type of a <input type="file"> element:
<!DOCTYPE html> <html> <body> Select a file to upload: <input type="file" id="myFile" size="50"> <button onclick="myFunction()">Change accepted file types</button> <p id="demo"></p> <script> function myFunction() {//ww w .j a v a 2 s .c o m document.getElementById("myFile").accept = "audio/*,video/*"; var v = document.getElementById("myFile").accept; document.getElementById("demo").innerHTML = v; } </script> </body> </html>