From the picture above, I want to clone the div with id #car2 and append it after the last div with id start with car, in this example id #car5. How can I do that? Thanks.
This is my try code:
$("div[id^='car']:last").after('put the clone div here');
You can use clone, and then since each div has a class of car_well you can use insertAfter to insert after the last div.
$("#car2").clone().insertAfter("div.car_well:last");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With