Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function listo(){
- mapa =[[0,2,3],[0,2,3],[0,2,3]];
- for (var i=0;i<3;i++){
- for (var j=0;j<3;j++){
- var newDiv = document.createElement("div");
- if (mapa[i][j]==0){
- newDiv.classList.add("rojo");
- }else{
- newDiv.classList.add("verde");
- }
- document.querySelector(".mapa").appendChild(newDiv);
- }
- }
- }
- window.onload=function(){
- listo()
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement