Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to unselect a select option box after some calculation is done

Tags:

jquery

just wondering how it's possible to un-select the select option box, i used .remove() but this actually removes the text from the select box,

is there any other way.

thanks

like image 361
akano1 Avatar asked Aug 05 '09 09:08

akano1


People also ask

How do I deselect a selected option?

You can deselect any cells within the selected range with the Deselect Tool. Pressing the Ctrl key, you can click, or click-and-drag to deselect any cells or ranges within a selection. If you need to reselect any of those cells, continue holding the Ctrl key and reselect those cells (for Mac, use the Cmd key).

How do I deselect a list?

If you accidentally select an item from a list and need to remove it, hold down the CTRL button (on a Windows PC) or the Command button (on a Mac) and click on the item you want to uncheck. This will deselect the item and it will no longer be highlighted.

How do I deselect multiple selections in HTML?

You can deselect options in a multi-value select list by ctrl-clicking it.

Is it unselect or deselect?

Dictionaries (Merriam-Webster and New Oxford American Dictionary) have deselect but not unselect. The NOAD defines deselect as “turn off (a selected feature) on a list of options on a computer menu”, which is what you want.


1 Answers

$('#mySelectBox :selected').attr('selected', '');

Where #mySelectBox is the id of your select element.

like image 94
Rob Knight Avatar answered Oct 19 '22 04:10

Rob Knight