JSFiddle - React, Tailwind, and code Playground

by TJ VanToll

HTML

<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<ul id="found">
    <li><code>closest</code> sporadically fails in Internet Explorer 11.</li>
</ul>

JavaScript

for (var i = 1; i <= 50; i++) {
    document.body.innerHTML += 
        i + ': ' + $( "li" ).closest( "#found" ).attr( "id" );
         
    document.body.innerHTML += "<br>";
}