In IE, the iframe of document. createElement cannot be used to set the resolution of the attribute name. createelement
The iframe name can be the target of the link or form, and the link or form can be opened to the iframe.
I have encountered a problem in IE that I cannot set the iframe name attribute.
JavaScript code
Var iframe = document. createElement ('iframe'); iframe. name = 'ifr'; // iframe. setAttribute ('name', 'ifr'); // This does not work either.
Neither of the above methods can be set. Later, we found that we could also create it like this.
JavaScript code
Var iframe = document. createElement ('<iframe name = "ifr"> </iframe> ');
In this way, there is no problem in IE, but this method cannot be passed in firefox. So last
JavaScript code
Try {var iframe = document. createElement ('<iframe name = "ifr"> </iframe>');} catch (e) {var iframe = document. createElement ('iframe'); iframe. name = 'ifr ';}
In this way, it is compatible.