the selectList can't make selected in Netscape...
Web Development
1
Posts
1
Posters
0
Views
1
Watching
-
I want to make a select box in a Javascript function, this is my code: var val = new Array('0','1','2','3','4','5'); var lis = new Array('java','php','asp','jsp','vbscript','jscript'); function makeOption(obj,selectID) { obj.options[0] = new Option(lis[0],val[0],false,false) for(i=1;i<lis.length;i++) if (val[i]==selectID){ obj.options[i] = new Option(lis[i],val[i],false,true); } else{ obj.options[i] = new Option(lis[i],val[i],false,false); } } var selectID = 3 makeOption(document.form1.ProgramList,selectID); The trouble is in Netscape the selectlist can't make selected with selectID("asp"), the selectlist its always select the first item "java". But this code run correct in IE. Is Anybody can help me, please? Thanks for all response!