The code below works fine in Chrome but does not work in Firefox. The error displayed in the Firefox console is “Error: document.forms.frmCreateNewEmployee.elements is not a function”.
document.forms['frmCreateNewEmployee'].elements('employeeType').value = document.getElementById("userType").options[document.getElementById("userType").selectedIndex].value;
How can I resolve this error?
Change
.elements('employeeType')to.elements['employeeType']to fix the error.