For example for the given jquery snippet, what should be the equivalent javascript. An equivalent add method in javascript can be helpful.
$("h1").add("span").add("h2");
As it clearly is mentioned in the jquery docs - .add()
does not add any DOM element. https://api.jquery.com/add/ So using, .appendChild()
does not serve the purpose here