Try this
var x = document.getElementById("loginid");
var options= x.options;
var selectedIndex ;
var dea = x.value;
for (var i= 0; i < options.length; i++) {
if (options[i].value == dea ) {
selectedIndex = i;
break;
}
}
alert(selectedIndex);
x.remove(selectedIndex);