Get attribute of SPAN using JavaScript

<span id='abc' email='xyz@gmail.com'> xyz </span>


How to get attribute of SPAN using JavaScript

document.getElementById('abc').getAttribute('email')


How to SPAN content or html or text using JavaScript

document.getElementById('abc').innerHTML

document.getElementById('abc').textContent