![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JavaScript
浪里个小胖子
这个作者很懒,什么都没留下…
展开
-
JavaScript给元素添加class属性
注意:element.classList.remove()、element.classList.add() — ie9及以下不兼容// 移除div的class属性obj.classList.remove('active'); // 添加class属性值// 方式一obj.className += 'new active';// 方式二// obj.className =...原创 2019-04-27 21:00:02 · 52183 阅读 · 0 评论 -
面试中的一些手写代码
手写call、apply、bind函数call实现// 实现Function.prototype.myCall = function(context) { if(typeof context === 'undefined' || context === null) { context = window } context.fn = this ...原创 2019-07-06 17:01:56 · 1351 阅读 · 0 评论