Reload particular element with jQuery
<p>I'm trying to reload particular element on button on click using jQuery, but when I click the button, the entire page gets loaded in this element. I have tried the following code which loads the entire page in this element. I want to load only particular element.</p>

<pre><code>&lt;script&gt;
    $(document).ready(function() {
        $("#button").click(function() {
            $("#demo").load(location.href + "#demo");
        });
    });
&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;div id="example"&gt;
        &lt;p id="demo"&gt;hi&lt;/p&gt;
        &lt;button id="button" type="button"&gt;press&lt;/button&gt;
    &lt;/div&gt;
</code></pre>