tags:

views:

59

answers:

1

Is there a way I could refresh or set to default just a portion of HTML (instead of reloading the whole) page with jquery? For example, I want to reset the following select on some click action. Please help. Many thanks in advance.

....
<select id="refresh">
   <option value="1" selected>1</option>
   <option value="2">2</option>
   <option value="3">3</option>
   <option value="4">4</option>
</selected>
......
+5  A: 

I assume you mean using AJAX. The easiest is to use .load. http://api.jquery.com/load/. Code would be

$("#refresh").load("page/to/load/content.html #content")

This loads the content within the content.html page that has an id of 'content' into the refresh element.

Of course you could use a server side page to generate the content like a php or ASP.NET page too.

Greg McGuffey