JSFiddle - React, Tailwind, and code Playground

HTML

<ol>
    <li>Some value</li>
    <li>another</li>
    <li>more</li>
    <li>more</li>
</ol>

JavaScript

var yourFunction = function (index) {
    alert(index);
};

$("ol").on("click", "li", function () {
    yourFunction($(this).index());
});