摘要: var div = document.getElementById('div1'); div.style.width = '100px'; div.style.height = '100px'; div.style.backgroundColor = 'red'; div.style.positio 阅读全文
posted @ 2020-01-05 10:49 shumeihh 阅读(156) 评论(0) 推荐(0) 编辑
摘要: var obj = { "2": "a", "3": "b", "length": 2, "push": Array.prototype.push } //属性要为索引(数字)属性,必须有length属性,最好加上push //push 相当于这样 // Array.prototype.push = 阅读全文
posted @ 2020-01-05 06:49 shumeihh 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Array.prototype.unique = function() { var temp = {}, result = [], len = this.length; for (var i = 0; i < len; i ++) { if(!temp[this[i]]) { temp[this[i 阅读全文
posted @ 2020-01-05 06:47 shumeihh 阅读(406) 评论(0) 推荐(0) 编辑
摘要: function typeOf(value) { var ret = typeof(value); var template = { "[object Array]": "array", "[object Object]": "object", "[object Number]": "number 阅读全文
posted @ 2020-01-05 06:45 shumeihh 阅读(228) 评论(0) 推荐(0) 编辑