📅  最后修改于: 2022-03-11 14:58:50.626000             🧑  作者: Mango
Running this code:
var e = document.getElementById("ddlViewBy");
var strUser = e.value;
Would make strUser be 2. If what you actually want is test2, then do this:
var e = document.getElementById("ddlViewBy");
var strUser = e.options[e.selectedIndex].text;