so I have a var that containssome jquery object which contains some elements (in this case <a> elements)
var elements = $('a');
I then want to add some other elements (in this case <b> elements) to this string when using a click function for instance...
elements.and('b').on("click", function(){
//some random code
});
Any way to do this?
Are you looking for add ?
elements.add('b')....
Note that $('a, b');
would do too.
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