Given an HTML form element like:
Older IE does not handle options of a select as child nodes, but all browsers implement the text property of a select's option collection.
function selectbytext(sel, txt){
if(typeof sel== 'string'){
sel= document.getELementById(sel) || document.getELementsByName(sel)[0];
}
var opts= sel.options;
for(var i= 0, L= opts.length; i