title: How to detect if mouse is clicked other than $(this) element
body: <p>I want to apply some styling if mouse is clicked inside an element (here <code>.block</code>). If the element is clicked get that element by <code>$(this)</code> and style it. Now after that, when the user clicks other than the <code>$(this)</code> element, I would like to change it back to default styling. How do I detect if mouse is clicked other than <code>$(this)</code> element.</p>
  
  <p>js script so far :</p>
  
  <pre><code>$( document ).ready(function() {
  
      // when a block is clicked get that specific block
      $('.block').click(function() {
          var block = $(this);
          block.css('background','red');
      });
  
      //if clicked other than the block do stuff
  
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/Aamu/ftq8a6ex/3/">jsfiddle</a></p>