JSFiddle - React, Tailwind, and code Playground

HTML

<div id="foo">first</div>
<div id="foo">second</div>
<div id="foo">third</div>

JavaScript

$(document).ready(function() {
    alert(
        'Selector: ' + 
        $('#foo').length + ' ' +
        $('#foo').text() + ' ' +
        'DOM: ' +  
        document.getElementById('foo').innerHTML 
    );
});