title: jQuery - remove() not working
body: <p>I have a script that places divs according the position of mouse on the body of a page. I have a button which says "Clear" and I want to use it to clear the divs created. How can I achieve that?</p>
  
  <p>The script and source I have written:</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;body&gt;
          &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"&gt;&lt;/script&gt;
          &lt;script src="bhaiya.js"&gt;&lt;/script&gt;
          &lt;button style="z-index: 2000;" class="clear" onclick="clear()"&gt;Clear&lt;/button&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>jQuery</strong></p>
  
  <pre><code>$(document).ready(function(){
  
      $(this).mousedown(function(e){
          $x = e.pageX;
          $y = e.pageY;
  
          $div = "&lt;div class='theDiv' style='width: 250px; height: 150px; background-color:#e7e7e7; position: absolute; top:" + $y + "px; left:" + $x + "px;'&gt;Hey&lt;/div&gt;";
          $("body").prepend($div);
      });
  
      function clear() {
          $(".theDiv").remove();
      }
  
  })
  </code></pre>
  
  <p><strong>jsFiddle:</strong>
  <a href="http://jsfiddle.net/BpAYz/">http://jsfiddle.net/BpAYz/</a></p>
  
  <p><strong>Any help would be appreciated :)</strong></p>