skip to Main Content

Html – How to get the hyperlink in a tag using javascript?

Here I have an html with javascript: document.addEventListener('mousedown', function(event) { let elem = event.target; let jsonObject = { Key: 'mousedown', Value: event.button }; if (event.button == 2) { console.log(elem.outerHTML); } }); <span style="font-size:xx-large"> <a href="https://microsoft.com" target="_blank" rel="noreferrer noopener" shape="rect" style="color:rgb(17,85,204)">…

VIEW QUESTION
Back To Top
Search