JS得到DropDownList的Value和Text

function CheckSelectNS()
            
{            
                
var selectText = document.FormStatus.DropDownListLevelSite.options[document.FormStatus.DropDownListLevelSite.selectedIndex].text 
                   
//var selectValue = document.getElementById("DropDownListLevelSite").value
                
if (selectText.substr(0,1!= "-")  
                
{        
                    alert(
"Please select ns site!");
                    document.getElementById(
"DropDownListLevelSite").selectedIndex = "0";
                }
                
            }
        
原文地址:https://www.cnblogs.com/songsh96/p/621949.html