JavaScript获取dropdownlist的text/value

     假设你的dropdownlist的ID为ddlSelect

  1. document.getElementById('ddlSelect').options[document.getElementById('ddlSelect').selectedIndex].value;  //获取value值
  2. document.getElementById('ddlSelect').options[document.getElementById('ddlSelect').selectedIndex].text;  //获取text值

你可能感兴趣的:(JavaScript)