I’m having quite a bit of trouble figuring out how I would do this:
$('.add_education').click(function() {
$('#education_form_clone:last').last().clone(true).appendTo('#education_form_container');
});
It doesn’t select the last element if it’s a newly created one. Basically I want to clone the last #education_form_clone (to get the values.) I understand it’s because it’s dynamically created and I’ve had to solve something like this before but I just can’t figure out for the life of me how I managed it.
:lastand.last()) for no good reason.You should use
classinstead ofid: