例子:
<div id=mxh>原来的</div>
<input onclick="document.all.mxh.insertAdjacentHTML('beforeBegin','<div>新 加的</div>')" type=button value="Insert Before">
<input onclick="document.all.mxh.insertAdjacentHTML('beforeEnd','<div>新加的 </div>')" type=button value="Insert Before End">
参数有两个,第一个:插入位置;第二个:插入内容;
<div id=mxh>原来的</div>
<input onclick="document.all.mxh.insertAdjacentHTML('beforeBegin','<div>新 加的</div>')" type=button value="Insert Before">
<input onclick="document.all.mxh.insertAdjacentHTML('beforeEnd','<div>新加的 </div>')" type=button value="Insert Before End">
参数有两个,第一个:插入位置;第二个:插入内容;
第一个参数的意义:
[插在这里,值为"beforeBegin"]<div id=test>[插在这里,值为"afterBegin"]
层内<nobr onmousemove="kwM(1);" onmouseout="kwL(event, this);" onmouseover="kwE(event,1, this);" oncontextmenu="return false;" target="_blank" onclick="return kwC();" style="border-bottom: 1px dotted rgb(102, 0, 255); text-decoration: underline; color: rgb(102, 0, 255); background-color: transparent;" id="key1">文字</nobr>
[插在这里,值为"beforeEnd"]</div>[插在这里,值为"afterEnd"]