There are so many ways to remove a specific div or more than one div of same class or id. It is tried to present all methods.

1. You can remove first or last div of same class or id.

The following code would remove first div of same class;


Similarly when we put last instead of first, it would remove last div of same class.


Note: In above example, class is used to remove the specefic div, same can be process with same id as changing code respectively. $(‘#div-same-id:first’).remove(); and $(‘#div-same-id:last’).remove();

to be continued…..


Leave a Reply