JSFiddle - React, Tailwind, and code Playground

HTML

<textarea id="text">ici tapez du texte...</textarea>      
<textarea id="codetouche">code touche...</textarea>

CSS

#text{       
    width       : 300px;
    height      : 400px;
      }
#codetouche{
    
    width       : 150px;
    height      : 400px;
    
}

JavaScript

var myTextbox = document.getElementById('text');

function checkComma(evt) {
     
    document.getElementById('codetouche').value = (
        "code touche : " + "\n\n"
            + "- charCode: " + evt.charCode + "\n"
			+ "- keyCode : " + evt.keyCode				
            );
	
	
    if (evt.charCode == 44) {       
        evt.preventDefault();			
        alert ("ATTENTION !!! \nLa virgule est interdite, utiliser le point du pav\351 num\351rique.");        
    }
}
myTextbox.addEventListener('keypress', checkComma, false );