i am new to javascript i have this :
$('#spn_inputs').append('<input type="file" name="myfile[] id="fileChooser" /><a href="javascript:void(0);" id="remove-file[]" onclick="this.parentNode.parentNode.removeChild(this.parentNode);">x</a><br/>');
<input type="file" name="myfile[] id="fileChooser" />
<input type="file" name="myfile[] id="fileChooser" />
<input type="file" name="myfile[] id="fileChooser" />
<input type="file" name="myfile[] id="fileChooser" />
I want to loop on each input and delete each when press x:
<a href="javascript:void(0);" id="remove-file[]" onclick="this.parentNode.parentNode.removeChild(this.parentNode);">x</a>
But this deleting all the inputs , and not only each one , how i do this properly ? thanks.
Aucun commentaire:
Enregistrer un commentaire