How would I get a part of my html along with the tags? For example:
I wanted to get this span inside the TD, in case I wanted it all together, until the tag <span>
, got it?
With pure JavaScript, just grab the outerHTML
element. For example, for this your span:
var span = document.querySelector('#play1_3_2');
var html = span.outerHTML;
console.log(html);
<span id="play1_3_2"></span>