logo

clearAll (removing all select-one, listbox items) (javascript)

JavaScript: The Definitive Guide
Author: David Nishimoto
davepamn@relia.net
Subject: clearAll

Overview: The clearAll will remove all listbox items from a select-one HTML control.

function clearAll(lbxSelection)
{
	while(lbxSelection.options.length>1)
	{
	lbxSelection.options[lbxSelection.options.length-1] = null;
	}
}
s