The following snippet doesn't work.
var empty = $();
var divs = $("div");
empty.add(divs);
There is a div element in the HTML and it is added correctly to divs. But the divs collection is not added to the empty jquery object. Any ideas what`s wrong with that?
.add
won't change the original object. Try:
empty = empty.add(divs);
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