JSFiddle - React, Tailwind, and code Playground

HTML

<ul>
    <li>one</li>
    <li>two</li>
</ul>

JavaScript

/*global $, alert */
var fnOutside = function(index) {
    alert( index + ": " + $(this).text() );
};
$( "li" ).each(fnOutside);