javascript - Display popup message when the number of a group of cells equals number of another group of cells -


i'm looking script displays popup message when number of yellow cells equals number of red cells. i've include picture of concept below. appreciated.

example colored table

hope classes of individual coloured blocks red_block , yellow_block

setinterval(function(){   var reds = document.getelementbyclassname('red_block')  var yellows = document.getelementbyclassname('yellow_block')  if(reds.length == yellows.length){    alert("what ever")  } }, 1); 

document.getelementbyclassname return array of element having class

giving timeinterval 1ms check values every moment


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -