TP

Size: a a a
TP
TP
LC
TP
TP
TP
KS
AP
if (select)
AP
LC
TP
LC
TP
LC
KS
TP
TP
AP
TP
<select id="ddlViewBy">
<option value="1">test1</option>
<option value="2" selected="selected">test2</option>
<option value="3">test3</option>
</select>
const e = document.getElementById("ddlViewBy");
const strUser = e.options[e.selectedIndex].value;
Would make strUser be 2. If what you actually want is test2, then do this:
const e = document.getElementById("ddlViewBy");
const strUser = e.options[e.selectedIndex].text;
LC