This is an integer value which is likely to be 1 most of the time. It is only meaningful if the Select.multiple property is true and more than one item has been selected.
Here is a workaround for other browsers that don't have this property, kindly donated by Jon Stephens:
<SCRIPT>
var mySize=0;
for(var i=0; i<mySelect.options.length; i++)
{
mySize += mySelect.options[i].selected ? 1 : 0;
}
mySelect.size = mySize;
</SCRIPT>| See also: | Select.multiple |
| Prev | Home | Next |
| Select.selectedIndex | Up | Select.tags() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. | ||