Dapatkan nilai dropdown pilihan di JS

var e = document.getElementById("ddlViewBy");
var strUser = e.options[e.selectedIndex].text;
Thoughtful Tortoise