我正在使用以下内容:
el = doc.createElement("input");
el.size = "2%";
我收到错误消息(在 Firebug 中)Index or size is negative or greater than the allowed amount
:。
当我只是注入 HTML 而不是正确构建 DOM 时,它工作正常,如下所示:
$rsc.html("<input name = 'myName' type = 'text' value = '" + myVariable + "' size = '2%' />");
为什么它不接受2%
with createElement?
谢谢