add() and remove()

Test elements

add()

Add an element in the W3C way. Script:

function addItNN()
{
	var element = document.getElementById('W3C');
	var newone = new Option('W3C option','something');
	element.add(newone,element.options[element.options.length]);
}

Add an element in the Microsoft way. Script:

function addItIE()
{
	var element = document.getElementById('W3C');
	var newone = new Option('Microsoft option','something');
	element.add(newone,1);
}

remove()

Remove the first option. Script:

function removeIt()
{
	var element = document.getElementById('W3C');
	element.remove(0);
}