title: jquery and using predefined function
body: <p>I'm trying to make a jquery plugin using a bootstrap class.</p>
  
  <pre><code>(function($) {
      $.fn.bsalert = function(klass, condition, hdr, msg) {
          if (condition) {
              this.html('&lt;strong&gt;' + hdr + '!&lt;/strong&gt; ' + msg);
              this.addClass(klass);
          } else {
              this.html("");
          }
      };
      $.fn.bssuccess = function(condition, hdr, msg) {
          //How to read a selector????
          $(selector???????).bsalert("alert alert-success", condition, hdr, msg);
      };
      $.fn.bswarning = function(condition, hdr, msg) {
          $(selector???????).bsalert("alert alert-warning", condition, hdr, msg);
      };
  })(jQuery);
  </code></pre>
  
  <p>And i tried using this:</p>
  
  <pre><code>$("#successmsg").bssuccess(error==="","OK","you've done");
  $("#errormsg").bswarning(error!=="","Error",error);
  </code></pre>
  
  <p>How do i read selector inside function definitions?</p>