【单选题】【消耗次数:1】
下列代码分析正确的是( )。 1 function createNode () { 2 var pl=document. createElement ( p ) ; 3 var txt=document. createTextNode ( Hello ! ) ; 4 pl.appendChild (txt) ; 5 document.appendChild (p) ; 6 }
代码第2行是创建一个p元素标记
代码第4行是为文档添加文本节点
p是文本节点的子节点
函数的功能是创建新的文本节点
参考答案:
复制
纠错
相关题目
【单选题】 下列代码分析正确的是( )。 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行是为文档添加文本节点
③  是文本节点的子节点
④  函数的功能是创建新的文本节点
【多选题】 文本节点之外,还有以下几种节点类型:()。
①  根节点
②  名字空间节点
③  处理指令节点
④  注释节点
【单选题】 关于以下JavaScript代码,说法正确的是( )。 var s = document.getElementsByTagName(p); for(var i = 0;i<s.length;i++) { s[i].style.display=none; }
①  隐藏了页面中所有id为p的对象
②  隐藏了页面中所有name为p的对象
③  隐藏了页面中所有标签为的对象
④  隐藏了页面中标签为的第一个对象
【单选题】 下面代码:int a[5];int *p;a[0]=1;a[1]=2;p=a;*p的值
①  a
②  1
③  2
④  null
【单选题】 在javaScript中,运行下列代码后的结果是 var d=1; document.write(typcof(d));
①  char
②  number
③  string
④  undefined
【单选题】 在*p之前插入节点*s的操作是()
①  q=s-next;s=p-next;
②  q-next=s;s-next=p;
③  s=p-next;q=s-next;
④  s-next=p;q-next=s;
【多选题】 在javascript中,下面代码表示获取文本框的值,则下列选项中验证文本框为空的条件表达式不正确的是() var userName=document.getElementById(txtName).value;
①  userName==
②  userName.length<=0
③  userName.length<0
④  userName.length=
【多选题】 在javascript中,下面代码表示获取文本框的值,则下列选项中验证文本框为空的条件表达式不正确的是()var userName=document.getElementById(txtName).value;(选择二项)
①  userName==
②  userName.length(=0)
③  userName.length(0)
④  userName.length=
【单选题】 关于以下JavaScript代码,说法正确的是( )。var s = document.getElementsByTagName(pfor(var i = 0;i(s.length;i++) { s[i].style.display=none}
①  隐藏了页面中所有id为p的对象
②  隐藏了页面中所有name为p的对象
③  隐藏了页面中所有标签为(p)的对象
④  隐藏了页面中标签为(p)的第一个对象
【单选题】 在javaScript中,运行下列代码后的结果是 var d=1document.write(typcof(d));(选择一项)
①  char
②  number
③  string
④  undefined
随机题目
【单选题】 She chose to be a teacher, but personally I’d to be a caregiver.
①  fancy
②  prefer
③  love
④  hate
【单选题】 _________ we’ve no money, we can’t buy it.
①  Since
②  Because of
③  Therefore
④  Why
【单选题】 We often compare children ______ flowers.
①  with
②  . to
③  in
【单选题】 Translation: Apple has entered the textbook market.
①  苹果公司已经开发了市场学教材。
②  苹果公司已经进入了教材市场。
③  苹果已经在市场上销售了。
④  苹果已经在市场了。
【单选题】 —It’s raining so heavily outside. I’m terribly anxious about my son’s safety. — .A. Well. He is a good boy.B. Yes, it is. It will rain tomorrow.C. Don’t worry about him. He will come back safe and sound.2. —Do you have much experience with caring for babies?
①  Well. He is a good boy.
②  Yes, it is. It will rain tomorrow.
③  Don’t worry about him. He will come back safe and sound.
【单选题】 Adictionarymaydefinegenetics_________simply“thescienceof thestudyof heredity”.
①  with
②  to
③  as
④  in
【单选题】 You are saying that everyone should be equal, and this is ____ I disagree.
①  why
②  where
③  what
④  when
【单选题】 She _________ the children not to make any noise.
①  tell
②  told
③  said
④  telling
【单选题】 This plant can’tbe exposed____________strong sunshine.
①  in
②  to
③  by
④  for
【单选题】 — I drove to Zhuhai for the air show last week. — Is that ____ you had a few days off?
①  why
②  when
③  what
④  which