Added a getSelectedValue function to datalist