Some jQuery code worth knowing

using jQuery with select boxes

 

Getting the number of elements:

jQuery("#select_id").children().size()

 

getting the value (not the option text) from multiple select box option

jQuery("#select_id").children().each(
        function(i)
        {
           s1+=jQuery(this).val();
        }
        );

Removing selected items from a multiple select box:

 jQuery("#select_id"+" :selected").each(
        function(i,selected)
        {        
            jQuery(selected).remove();
        //alert("removing "+);
        });