JSFiddle - React, Tailwind, and code Playground

HTML

<body>
    
<div id="espacioPrueva">
</div>
<div id="log"></div>
    
</body>

CSS

#log{
    width:200px;
    height:100px;
    color:#000000;
    font-size:25px;
}

JavaScript

function prototype(id){	
	
	this.ID = id;
	
	
	this.CrearDiv = function CrearDivs(){
        
        ID_DuplicoLaVariableParaElAlcanceDelaPila = this.ID;
		
		Capa = document.getElementById('espacioPrueva');
		DivPrueva = document.createElement('div');
		DivPrueva.style.width = 200+'px';
		DivPrueva.style.height = 200+'px';
		DivPrueva.style.margin = '10px 10px';
		DivPrueva.style.background = 'hsla(120,100%,50%,1)';
		Capa.appendChild(DivPrueva);
      
		DivPrueva.addEventListener("mouseover", function () {document.getElementById('log').innerHTML =         ['ObjetoPrueva'+ID_DuplicoLaVariableParaElAlcanceDelaPila]}, false);
	
	}
	
}

var ObjetoPruevaUno = new  prototype(1);
ObjetoPruevaUno.CrearDiv();


var ObjetoPruevaDos = new  prototype(2);
ObjetoPruevaDos.CrearDiv();