How can I get all attributes (e.g. href) of all elements matching a jQuery selector?
href
One-liner with ES6 arrow functions, using jQuery .map():
const ids = $('a.someClass').map((i, el) => el.getAttribute('href')).get(); console.log(ids);
t1 t2 t3