03 2022 档案
摘要:首先NodeList和HTMLCollection都是DOM节点的集合。 NodeList中包含的节点类型可能是Element/Text/Comment/Document/DocumentFragment等,我们知道nodeType的种类有12种。NodeList由Node.childNodes和d
阅读全文
摘要:<!DOCTYPE html> <html> <head> <style type='text/css'> #test { padding: 1em; font-size: 50px; font-weight: bold; color: red !important; } </style> </he
阅读全文
摘要:今天在跑项目过lint时报错了,如下图查了下大概意思是不要使用对象原型上的方法,因为原型上的方法可能被重写了。那重点来了如何修复呢? // bad if (obj.hasOwnProperty('name')) { } // good if (Object.prototype.hasOwnPrope
阅读全文