vendredi 28 novembre 2014

Adding File Input after first Input clicked



<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Sample</title>
</head>
<body>
<ul>
<form>
Upload Assignment: <br>
<div id="file_Input">
<input type="file" name="upload" value="Submit" onclick="addButton();">
</div>
<br>
<input type="submit" value="Submit">
</form>
</ul>

</body>
</html>
<script type="text/javascript">
function addButton(){
var input=document.createElement('input');
input.type="file";
document.getElementById("file_Input").appendChild(input);
}
<script>


I am trying to add a new input file, after the user clicks on the first, so that each time they add an upload file they have the option to adding another file input. I am new to JS and this is one of my first scripts. Any help is greatly appreciated!





Aucun commentaire:

Enregistrer un commentaire