You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JS library that makes DOM API more wide and useful
;(function(){// Query sellectorsvarqs=function(css){returndocument.querySelector(css);};varqsa=function(css){returndocument.querySelectorAll(css);};// Create elementsvarel=function(type,props,children){returndocument.createElement(type,props,children);};vartxt=function(string){returndocument.createTextNode(string);};// Find text on a page (returns true or false) *varfind=function(string){varresult=document.documentElement.innerHTML.indexOf(string);result=(result!=-1) ? true : false;returnresult;};// Class Replacement Element.prototype.replaceClass=function(oldClass,newClass){this.classList.remove(oldClass);this.classList.add(newClass);};// Function check if the element included on a page body *Element.prototype.isInPage=function(){return(this===document.body) ? false : document.body.contains(this);};window.dom={qs: qs,qsa: qsa,el: el,txt: txt,find: find};})();