下列代码是添加一个iframe节点,
方法1用getElementByClassName 方法2用getElementById
测试时在父节点wraper中做出相应的id-class的切换
方法1错误,方法2实现
原因如下 打印出getClass和getId的节点,一个为单个节点,一个为节点集合
appendChild能添加获取的id节点不能添加class节点集合
下列代码是添加一个iframe节点,
方法1用getElementByClassName 方法2用getElementById
测试时在父节点wraper中做出相应的id-class的切换
方法1错误,方法2实现
原因如下 打印出getClass和getId的节点,一个为单个节点,一个为节点集合
appendChild能添加获取的id节点不能添加class节点集合