title: how to add id for an element in jquery
body: <p>I have number of element which have same class name. But i want to give id for one the element which is clicked by the user.</p>
  
  <pre><code> $('body').click(function(event) {
      $(document).on('click', '.l1', function(){
          $('.l1').removeAttr('id');
          $('.l1').attr('id','selected');
      });
      $(document).on('hover', '.l1', function(){
      alert($(this).attr('id'));
      });
   });
  </code></pre>
  
  <p>Fiddle :</p>
  
  <p><a href="http://jsfiddle.net/JamesPJ/h722g/141/" rel="nofollow">http://jsfiddle.net/JamesPJ/h722g/141/</a></p>