Some commonly used methods package

Gets node

   function $(id) {
            var obj = document.querySelectorAll(id);
            return obj.length > 1 ? obj : obj[0];
        }

Guess you like

Origin www.cnblogs.com/City-wall/p/11611959.html