简体   繁体   English

如何修复 Firefox 控制台中的“不是函数”JavaScript 错误?

[英]How can I fix a “not a function” JavaScript error in Firefox's console?

The code below works fine in Chrome but does not work in Firefox.下面的代码在 Chrome 中运行良好,但在 Firefox 中不起作用。 The error displayed in the Firefox console is "Error: document.forms.frmCreateNewEmployee.elements is not a function". Firefox 控制台显示的错误是“错误: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..elements('employeeType')更改为.elements['employeeType']以修复错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM