Monday, October 06, 2008

Select box manipulation with jQuery - update to removeOption, new selectedOptions

Check the Select Box Manipulation project page at the jQuery site for the latest download.

1 comment:

Anonymous said...

hi, Im JC i added this to ..
/**
* Returns text which have been selected
*
* @name selectedValues
* @author Sam Collett, modify by Juan Carlos Dominguez
* @type Array
* @example $("#myselect").selectedText();
*
*/
$.fn.selectedText = function()
{
var v = [];
this.find("option:selected").each(
function()
{
v[v.length] = this.text;
}
);
return v;
};

you will get all selected options into array.