name是readonly的,
请参看MS给的参考书,里面专门对这一点及解决方法做了讲解:
---------------------The NAME attribute cannot be set at run time on elements dynamically created with the createElement method. To create an element with a name attribute, include the attribute and value when using the createElement method.ExamplesThe following example shows how to set the NAME attribute on a dynamically created A element.var oAnchor = document.createElement("<A NAME='AnchorName'></A>");
请参看MS给的参考书,里面专门对这一点及解决方法做了讲解:
---------------------The NAME attribute cannot be set at run time on elements dynamically created with the createElement method. To create an element with a name attribute, include the attribute and value when using the createElement method.ExamplesThe following example shows how to set the NAME attribute on a dynamically created A element.var oAnchor = document.createElement("<A NAME='AnchorName'></A>");
看来是没有办法给iframe 创一个name的属性了
还好FF游览器也兼容了这个BUG
var HaIframe = document.createElement("<iFrame name=\"MyIframe\"></iFrame>");