How can I reload or set to default (using javascript or jquery) only a particular tag (or id) in my html page. For instance, if I want to set the following select option to default "selected", if something else is currently in selection, without reloading the entire page through javascript confirm() function as follows:
var answer = confirm("Clicking 'OK' will revert to the default option.");
if (answer) { // ie, if i click 'OK'
selected = $(this).val();
//set the select drop-down option to "aaa"
//location.reload() reloads the entire page
} else {
$(this).val(selected);
}
...more...
<select size="1" name="choice" id="choice">
<option value="aaa" selected>aaa</option>
<option value="bbb">bbb</option>
<option value="ccc">ccc</option>
</select>
...html...
Many thanks in advance.