当前位置: 代码迷 >> Web前端 >> node 创设
  详细解决方案

node 创设

热度:514   发布时间:2012-08-26 16:48:06.0
node 创建

var node = Y.one('#main');


var item = Y.Node.create('<p>test</p>');//创造节点



node.appendChild(item);//加入

Y.one("#main").setContent("<h1>Hello, <em>World</em>!</h1>");//设置节点内容,会替换原来节点中存在的内容


node.append("<p>This is the end, beautiful friend, the end.</p>");//直接这样也可以把创造的节点加入到指定节点下

??

?

  相关解决方案