title: jquery plugin multiple instance not working
body: <p>I have written 1-2 jquery plugins but all of them fails when i try to use multiple instances....i didnt find any solution. Please take a look at below code, if u create 2 instances on this plugin its not working....whats wrong with this code. what makes plugin able to run multiple instances ??</p>
  
  <pre><code>&lt;!doctype html public "-//w3c//dtd html 4.0 transitional//en"&gt;
  &lt;html&gt;
   &lt;head&gt;
   &lt;/head&gt;
   &lt;script src="jquery.js"&gt;&lt;/script&gt;
   &lt;script&gt;
       (function($){  
       $.fn.truncate = function(options) {  
  
        return this.each(function() {  
         obj = $(this);  
         var body = obj.html();  
  
      $(obj).focus(function(){
         alert($(obj).attr("id"));
      });    
  
        });  
       };  
      })(jQuery);
      &lt;/script&gt;
   &lt;SCRIPT LANGUAGE="JavaScript"&gt;
   &lt;!--
     $().ready(function(){  
      $('#t1').truncate();
      $('#t2').truncate();
     });    
   //--&gt;
   &lt;/SCRIPT&gt;
   &lt;body&gt;
     &lt;input type="text" id="t1"&gt;
     &lt;input type="text" id="t2"&gt;
   &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>