养浩然之气,活着不是为技术,请关心身边的人.

insertBefore

上一篇 / 下一篇  2007-11-21 17:28:06 / 个人分类:php

<scrīpt>
function insertElement()
{
var nod=document.createElement("LI");
oUL1.insertBefore(nod, oLIYellow);
nod.innerText="Orange";
var txt1 = document.createTextNode("test1");
var txt2 = document.createTextNode("test2");
var p=text1.parentNode;
p.insertBefore(txt1,text1.nextSibling);
if(p.lastChild==txt1)
p.appendChild(txt2);
}
</scrīpt>
</HEAD>
<BODY>
<SPAN ōnclick=insertElement()>Click <B>HERE</B> to add an item to the following list.</SPAN>
<UL id="oUL1">
<LI id="oLIRed">Red</LI>
<LI id="oLIYellow">Yellow</LI>
<LI id="oLIBlue">Blue</LI>
</UL>
<br>
<p id='p1'><input id='text1' value='111'/></p>
</BODY>

TAG: php

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

数据统计

  • 访问量: 20200
  • 日志数: 146
  • 建立时间: 2007-08-01
  • 更新时间: 2008-02-20

RSS订阅

Open Toolbar