{
String type = evt.getType();
EventTarget currTarget = evt.getCurrentTarget();
if (currTarget == selectElem)
{
HTMLCollection col = selectElem.getOptions();
String str = type + " ";
for(int i = 0; i < col.getLength(); i++)
{
HTMLOptionElement option = (HTMLOptionElement)col.item(i);
Text item = (Text)option.getFirstChild();
boolean selected = option.getSelected();
str += item.getData() + "(" + selected + ") ";
}
outText(str);
}
else if (currTarget == addItemElem)
{
Document doc = itsNatDoc.getDocument();
HTMLCollection col = selectElem.getOptions();
HTMLElement option;
HTMLElement firstOpt = (HTMLElement)col.item(0); // puede ser null
option = (HTMLElement)doc.createElement("option");
option.appendChild(doc.createTextNode(Integer.toString(col.getLength())));
selectElem.add(option, firstOpt);
option = (HTMLElement)doc.createElement("option");
option.appendChild(doc.createTextNode(Integer.toString(col.getLength())));
selectElem.add(option,null);
}
else if (currTarget == removeItemElem)
{
if (selectElem.getLength() > 0)