zoukankan      html  css  js  c++  java
  • document.createElement在IE和Firefox下的差异

    IE有3种方式都可以创建一个元素:

    1 document.createElement("<input type=text>")
    2 document.createElement("<input>")
    3 document.createElement("input")

    Firefox只支持一种方式:
    document.createElement("input");document.setAttribute(name,value);

    ------------
    注: 在一个节点下增加子节点 IE也比Firefox下的方式要多.

    IE: 

    1 node.insertBefore(Element)
    2 node.insertAfter(Element)
    3 node.appendChild(Element)

    而Firefox仅支持 node.appendChild.

    在IE里面,html元素如果可以作为容器,那么在document.createElement创建元素时是无法设置name属性的,比如:div,span,font等等。
    相反不可以做为容器的,在用document.createElement创建元素时可以设置控件的name属性,比如:input,button,a,img等等

  • 相关阅读:
    veil-evasion免杀处理
    对程序"加料"
    堆栈溢出
    ICMP隧道 ptunnle
    socat流量操控
    DNS隧道 iodns
    dns隧道 dns2tcpd
    ssh X协议转发
    ssh动态端口转发
    ssh远程端口转发
  • 原文地址:https://www.cnblogs.com/stephenykk/p/3214378.html
Copyright © 2011-2022 走看看