Node.prototype.display=function() { console.log(this.textContent); } let qq = document.querySelectorAll(".q"); qq[0].display(); }