Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript change color for class name

function reset() {
	var elements = document.getElementsByClassName('pixel'); // get all elements
	for(var i = 0; i < elements.length; i++){
		elements[i].style.backgroundColor = "white";
	}
}
Source by discuss.codecademy.com #
 
PREVIOUS NEXT
Tagged: #javascript #change #color #class
ADD COMMENT
Topic
Name
2+7 =