title: Bind Event to Custom Plugin Function in jQuery
body: <p>How would I modify my plugin to allow to load with an event on the call? Right now the plugin is loading when the page loads and I want it to work with .blur() or whatever event I want to assign it instead. Any help would be appreciated:</p>
  
  <pre><code>// The Plugin
  (function($) {
    $.fn.required = function() {
      return this.each(function() {
  
        var $this = $(this), $li = $this.closest("li");
        if(!$this.val() || $this.val() == "- Select One -") {
          console.log('test');
          if (!$this.next(".validationError").length) {
            $li.addClass("errorBg");
            $this.after('&lt;span class="validationError"&gt;err msg&lt;/span&gt;');
          }
        } else if($this.val() &amp;&amp; /required/.test($this.next().text()) === true) {
          $li.removeClass("errorBg");
          $this.next().remove();
        }
  
      });
    }
  })(jQuery);
  
  // The Event Call
  $("[name$='_required']").required().blur();
  </code></pre>
  
  <p>It's not working on blur(), it's triggering the plugin on document load instead of the .blur() event.</p>