摘要:
什么是DOM 1:文档对象模型(DocumentObjectModel,DOM) 2:DOM定义了访问和操作HTML文档的标准方法。 3:DOM将HTML 文档表达为树结构。 其他查询元素的方法: document.querySelector(" ") //获取元素 .表达根据类查找 #表示根据id 阅读全文
摘要:
js获取属性的方法: document.getElementById(); document.getElementsByTagname(); document.getElementsByClassname(); document.getElementsByname(); window.onscrol 阅读全文
摘要:
charCodeAt() 方法可返回指定位置的字符的 Unicode 编码 这个返回值是 0 - 65535 之间的整数。 stringObject.charCodeAt(index) /* a-z 97-122 A-Z 65-90 0-9 48-57 */ fromCharCode() 可接受一个 阅读全文
摘要:
1 //push(); 2 定义:可以可向数组的末尾添加一个或更多元素,并返回新的长度。 3 方法:push(); 4 语法:数组.push(新元素1,新元素2,....,新元素x) 5 返回值:把指定的值添加到数组后的新长度。 6 原数组:已经改变。 7 8 //pop(); 9 定义:用于删除并返回数组的最后一个元素。 10 语法:数组.pop(); ... 阅读全文
摘要:
typeof([ ])的返回值是object,因为数组叫做数组对象。 Array有length属性,而Object没有length属性,所以可以根据length属性来判断数据属于数组还是对象。 Array.isArray(arr)判断arr是否为数组。 arr instanceof Array 判断 阅读全文