下面的代码在 Chrome 中运行良好,但在 Firefox 中不起作用。 Firefox 控制台中显示的错误是“错误:document.forms.frmCreateNewEmployee.elements 不是函数”。
document.forms['frmCreateNewEmployee'].elements('employeeType').value = document.getElementById("userType").options[document.getElementById("userType").selectedIndex].value;
如何解决此错误?
最佳答案
将 .elements('employeeType')
更改为 .elements['employeeType']
以修复错误。
关于javascript - 如何修复 Firefox 控制台中的 "not a function"JavaScript 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6798965/