I have a upload script that is adding and extra upload button (that works fine), but the remove button does not work
var i = $("#AddFileInputBox div").size() + 1;
$("#AddMoreFileBox").click(function () {
event.returnValue = false;
if(i < MaxFileInputs)
{
$('<span><input type="file" id="fileInputBox" size="20" name="file[]" class="addedInput" value=""/><a href="#" class="removeclass small2"><img src="images/close_icon.gif" border="0" /></a></span>').appendTo(FileInputsHolder);
i++;
}
return false;
});
$("body").on("click",".removeclass", function(e){
event.returnValue = false;
if( i > 1 ) {
$(this).parents('span').remove();i--;
}
});
Chrome console:
Uncaught TypeError: Object #<Object> has no method 'on'
line: 113, which is
$("body").on("click",".removeclass", function(e){
Thanks for any help in advance