下列代码分析正确的是( )。 1 function createNode () { 2var pl=document. createElement ( p ) ; 3 var txt=document. createTextNode ( Hello ! ) ; 4 pl.appendChild (txt) ; 5 document.appendChild (p) ; 6 }

发布时间:2022-04-02 18:23:33 作者:wudongabc..1 阅读量:188

下列代码分析正确的是( )。 1 function createNode () { 2var pl=document. createElement ( p ) ; 3 var txt=document. createTextNode ( Hello ! ) ; 4 pl.appendChild (txt) ; 5 document.appendChild (p) ; 6 }


代码第2行是创建一个元素标记

代码第4行是为文档添加文本节点

是文本节点的子节点

函数的功能是创建新的文本节点


点击这里跳转到答案查看网获取答案

正确答案网   网站地图

皖ICP备18026791号-5

Catfish(鲶鱼) CMS V 6.7.3