function call(op) {
var x = op.selectedOptions[0].textContent;
var n = x.substring(0, 3);
//alert(n);
document.pts.inputbox.value = n;
document.p
Try this
function call(op) {
var x = op.options[op.selectedIndex].text;
var n = x.substring(0, 3);
alert('Index : '+op.selectedIndex+' and first 3 lettrs are : '+n);
}
DEMO.
Based on a quick JSFiddle, the selectedOptions
collection isn't widely supported yet.
Fails/Unsupported:
Works: