We are using the URL to pre-populate a select field (Drop Down) on a form.
IE: ?Employee_Name=Test User
Then we are getting the selected index to see what is selected on document load
$(document).ready(function() { var dropDownListRef = document.getElementById('Field1'); var selectedIndex = dropDownListRef.selectedIndex; console.log(selectedIndex); });
The selected index is always returning -1. Why is that?