Boa noite pessoal preciso de ajuda com o chat de html que o meu professor passou estou tendo muita dificuldade de fazer ele funcionar quem puder ajudar agradeço.
 
	 
 
	<!DOCTYPE html> 
	<html lang="pt-BR"> 
	    <head> 
	    <script>
 
	        function enviar(text)
 
	        { 
	         var text = document.getElementById('text').value;
 
	        document.getElementById('boxC').innerHTML += "<p>"+ text + "</p>";
 
	        }
 
	        </script> 
	         <meta charset="UTF-8" /> 
	         <title>Chat</title> 
	         <style type="text/css"> 
	            #boxA, #boxB { 
	                float:left; width:400px; height:180px; padding:10px; margin:10px; color:#ffffff; 
	            } 
	             #boxA { background-color: blue; } 
	             #boxB { background-color: green; } 
	             #boxC { 
	                float:left; width:840px; height:300px; padding:10px; margin:10px; color:#ffffff;overflow: auto; 
	            } 
	            #boxC { background-color: gray; } 
	         </style> 
	    </head> 
	     <body> 
	         <div id="boxA"> 
	             <center><h1>Pesssoa 1</h1></center> 
	             <p style="text-align:right;">Nome: <input type="text" id="pes1" style="width:300px;"/><br/><br/> 
	             Mensagem: <input type="text" id="msgpes1" style="width:300px;"/><br/><br/> 
	             <input type="button" id="enviarPes1" value="Enviar" onclick="enviar(1);"/> </p> 
	         </div> 
	         <div id="boxB"> 
	             <center><h1>Pesssoa 2</h1></center> 
	             <p style="text-align:right;">Nome: <input type="text" id="pes2" style="width:300px;"/><br/><br/> 
	             Mensagem: <input type="text" id="msgpes2" style="width:300px;"/><br/><br/> 
	             <input type="button" id="enviarPes2" value="Enviar" onclick="enviar(2);"/> </p> 
	         </div> 
	         <div id="boxC"></div>
 
	     </body> 
	</html>