Javascript examples for DOM HTML Element:Input FileUpload
Input FileUpload accept Property - Accept multiple content types:
<!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. com*/ document.getElementById("myFile").accept = "audio/*,video/*"; document.getElementById("demo").innerHTML = "accepted file types have been set. Click 'Choose File' to see the effect."; } </script> </body> </html>