Atribua um novo método a cada nó

<head>
	  <script>
 function add()
		  {
			  Node.prototype.d = function(){
			  console.log(this.textContent)	
};
let a =			  document.getElementById("a");
let b =			  document.getElementById("b");
a.d();
b.d();
}
      </script>  
  </head>
  <body>
<button id="btn" onclick="add()">Press </button>
<div id="a">aaaa</div>
<div id="b">bbbb</div> 
</body>
Javasper