0
如何檢查javascript中的值。例如:檢查javascript中的值
document.formname.subcategory.options[0]=new Option("Select Sub-Category","");
document.formname.subcategory.options[1]=new Option("Colleges","Colleges");
document.formname.subcategory.options[2]=new Option("Institutes","Institutes");
document.formname.subcategory.options[3]=new Option("Schools","Schools");
document.formname.subcategory.options[4]=new Option("Tuitions","Tuitions");
document.formname.subcategory.options[5]=new Option("Universities","Universities");
我該如何檢查它的值是「Colleges」還是「Schools」等?這是這樣嗎?
document.formname.subcategory.options.value == "Universities"
還是這樣?
document.formname.subcategory.options.value == 5