I have an issue with IE (I want to support IE users Grrrr):
$(function () {
var clonedField = $('.child').clone(),
main = $('.append');
$('', {
text: 'delete',
class: 'icon-delete',
href: '#',
click: function () {
$(this).parent().remove();
return false;
}
}).appendTo(clonedField);
$('#add-input').click(function () {
main.append(clonedField.clone(true));
return false;
});
})
The error is: expected identifier, string or number
Line 142: href: '#',
The problem is that IE treats “class” as a reserved keyword. Put it in quotes, like this:
This is actually stated on the $.attr reference page.