JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/dot-luv/jquery-ui.css">
<div id="bob"></div>

JavaScript

jQuery.fn.myMethod = function() {
  return this.each(function(){
    doSomething(jQuery(this).attr("id"));
  });
    
  function doSomething(id){
      alert(id);
  }
  function doSomethingElse(){
    // some code
  }
};


$("div").myMethod();