Input FileUpload accept Property - Accept multiple content types: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input FileUpload

Description

Input FileUpload accept Property - Accept multiple content types:

Demo Code

ResultView the demo in separate window

<!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>

Related Tutorials