原型 javascript 无法正常工作

Prototype javascript not working properly

我在我的 project.But 中使用原型 JavaScript 库 1.7.2,当我在 IE11 中打开它时,它给我下面的 JavaScript createElement 代码的错误。也不能在其他浏览器中工作。只有 IE11 调试器显示此错误

代码:var el = document.createElement('<input name="x">');

错误:InvalidCharacterError

它是本机客户端 Javascript,所以对我来说它似乎与 PrototypeJS 无关。 correct syntax

var el = document.createElement('input');
el.name = "x";

要创建您在 PrototypeJS 中提到的元素,您可以这样做:

var el = new Element('input',{'name':'x'});

这将适用于 PrototypeJS 支持的所有浏览器