JSFiddle - React, Tailwind, and code Playground

by anandhinava

HTML

<div id="qunit-fixture">
    <ul>
      <li>foo</li>
      <li>bar</li>
      <li>baz</li>
    </ul>
</div>

JavaScript

(function($){

  $.fn.enumerate = function(start) {
    if (typeof start !== "number") {
      start = 1;
    }
    return this.each(function(i) {
      $(this).prepend((start + i) + ". ");
    });
  };

}(jQuery));