let docs, toCopy docs = Array.from($('.hp-list-item-doc')) toCopy = '' docs.forEach(doc => { // let name = doc.querySelector('.hp-list-item-title').firstChild.innerText toCopy += ` ` + doc.href }) copy(toCopy)