开发者

How can I fix a "not a function" JavaScript error in Firefox's console?

开发者 https://www.devze.com 2023-03-22 04:47 出处:网络
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\".

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消