DOM操作

来源:互联网 发布:开发直播软件多少钱 编辑:程序博客网 时间:2024/05/16 11:26

DOM操作:
获取节点:
document:唯一性:
getElementById
getElementByTagName
getElementByName
节点指正:都不是方法,是属性。
firstChild
lastChild
childNodes
previousSiblings
nextSibling
parentNode
节点操作:方法
创建节点:
createElement
createAttribute
createTextNode
插入节点:
appendChild
insertBefore
替换节点:
replaceChild
赋值节点:
cloneNode
删除节点:
removeChild
属性操作:方法
getAttribute
removeAttribute
setAttribute
文本操作:
insertData(offset,string):从指定位置插入
appendData(string)
deleteData(offset,count)
replaceData(off,count,string);
splitData(offset);
substring(offset,count);

0 0
原创粉丝点击