Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Assigning All NodeLists A New Function


NodeList.prototype.forEach = function()
	  {
	  	
		
		  for(var i =0; i<this.length; i++)	
		  {
		  	
			  console.log(this[i].textContent);
		  }
		
		
		
	  }	 
let x = 	  document.querySelectorAll(".myclass");
x.forEach();
 
PREVIOUS NEXT
Tagged: #Assigning #All #NodeLists #A #New #Function
ADD COMMENT
Topic
Name
2+6 =