Question: I don't know if this is possible but I'd like to refresh the contents in a div when a button is clicked.

Example:

```
 <div id="div"> 
 Some contents
</div>
<input type="button" value="button" onClick="div.refresh()"/>

```

I'm not trying to change the contents of the div just to refresh only that part of the page.

Is this possible?

Answer: 
In the following example, the jQuery [load](http://api.jquery.com/load/) function returns the content of the site `page.html`, searches the DOM element (here with id `div2`) and remembers the HTML content. The HTML content of the main selected DOM element (here with id `div1`) is replaced with the new content.

```
$('#div1').load('page.html #div2');

```

The following code will replace your `div` html with the current content.

```
function div_refresh() {
    $('#div').load(window.location.href + ' #div');
}

```

Also see my [example](http://jsfiddle.net/qkUe7/show/).
> 
> Im not trying to change the contents of the div just to refresh only
>  that part of the page.
> 
> 
> 

That doesn't make much sense. If you want to refresh part of the page, you want to change content somewhere...

Anyway, it's certainly possible.

if your div has attribute `id="myDiv"` then you would do something like

`$('#myDiv').html('updated content');`

as a simple example. The `$('#myDiv')` has jquery select the element with id `myDiv`, and the `html` call changes to value in the div...Documentation [here](http://api.jquery.com/html/).

Again, that's a really simple example of how to change the content of just a div with jQuery....