title: Jquery Add/Remove class on click
body: <p>I want to add select class on clok of paragraph tag. I written code but it is not working. please suggest.</p>
  
  <p>code is given below:</p>
  
  <pre><code>&lt;style type="text/css"&gt;
      #elm p { background:#FF0000; color:#FFFFFF; font-weight:bold;}
      .select{ background:#000099;}
  
  &lt;/style&gt;
  &lt;script type="text/javascript" src="js/jquery-1.10.2.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  
  $(document).ready(function(){
      $('#elm').click( function(){ $("p").addClass('hover') });
      function(){ $("p").removeClass('hover') }
  });
  });
  
  &lt;/script&gt;
  </code></pre>