<section id="container" ondrop="drop(event)" ondragover="allowDrop(event)">
  <div class="padre">
     <div class="tipo" id="fuego" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
     <div class="tipo" id="agua" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
  </div>
  <img class="pokemon" src="http://i65.tinypic.com/j0itlk.png" draggable="true" ondragstart="drag(event)" id="drag1" name="fuego"/>
  <img class="pokemon" src="http://i65.tinypic.com/214vxts.png" draggable="true" ondragstart="drag(event)" id="drag2" name="agua"/>
  <img class="pokemon" src="http://i66.tinypic.com/ckf41.jpg" draggable="true" ondragstart="drag(event)" id="drag3" name="fuego"/>
  <img class="pokemon" src="http://i66.tinypic.com/2nq5pp3.png" draggable="true" ondragstart="drag(event)" id="drag4" name="agua"/>
</section>
<div id="resultado">...</div>
#container {
  width: 580px;
  height: 250px;
  margin: 0 auto;
  border: 1px solid black;
  text-align: center;
}
.padre {  
  width: 580px;
  height: 120px;
  display: flex;
}
.tipo {
 flex-grow: 1;
}
#fuego {
 background-color: #ffd54c;
}
#agua {
  background-color: #42ccff;
}
#resultado {
  text-align: center;
  font-size: 30px;
}
.pokemon {
   margin: 10px;
   height: 80px;
   width: 80px;
}
function allowDrop(ev) {
  ev.preventDefault();
}

function drag(ev) {
   ev.dataTransfer.setData("text", ev.target.id);
}

function drop(ev) {
  ev.preventDefault();
  var data = ev.dataTransfer.getData("text");
  ev.target.appendChild(document.getElementById(data));
  testing();
}

function testing(){
  var correcto = 1;
  var pokes = document.getElementsByClassName("pokemon");
  for(var i=0;i<pokes.length;i++){
     if(pokes[i].getAttribute("name") != pokes[i].parentNode.getAttribute("id")){
       correcto = correcto*0;
       break;
     }
  }
  if(correcto == 1){
    document.getElementById("resultado").innerHTML = "CORRECTO"; 
  }else{
    document.getElementById("resultado").innerHTML = "INCOMPLETO";
  }
  
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.