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.
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
Post a Comment