字符串方法

nodeType 判断节点类型
attributes 获取元素身上所有属性构成的集合
getAttribute 获取元素的属性值
setAttribute 给元素设置属性和属性值
childNodes 获取元素的子节点
firstChild 获取单个子节点 firstElementChild 标准流加Element
lastChild 获取最后一个子节点 lastElementChild
previousSibling 获取上一个兄弟节点 previousElementSibling
nextSibling 获取下一个兄弟节点 nextElementSibling
appendChild 添加节点
createElement 创建节点元素
charAt 返回指定位置数字的字符
concat 连接两个字符串
indexOf 查找字符在字符串中的位置
lastIndexOf 同上 如果有相同的字符从后开始
slice 实际截取1——5 没有6
typeof 把字符串分割成字符串数组
substr 同slice 但是有6
substring 与slice一样
toLowerCase 将所有大写转成小写
toUpperCase 将所有小写转成大写
trim 去除字符串两边的空格

posted on 2018-12-02 19:15  梦泽123  阅读(77)  评论(0编辑  收藏  举报

导航