var canvas = document.getElementById("draw"); var x = canvas.getContext("2d"); x.font = '32px Arial'; x.fillStyle = '#007439'; x.fillText("A", 15, 35); $("#a").click(function() { var clone = $(this).clone(); console.log(clone); }); #stroka { position: absolute; top: 20px; left: 20px; right: 10px; height: 100px; background: white; padding: 5px; border: solid 1px black; } #a { position: absolute; top: 140px; left: 20px; width: 50px; height: 50px; background: white; padding: 5px; border: solid 1px black; } <div> <div id="stroka"></div> <div id="a" class="item"> <canvas id='draw' width='50' height='50'></canvas> </div> </div> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="//ajax.aspnetcdn.com/ajax/jquery.ui/1.10.3/jquery-ui.min.js"></script> How to make so that when you press the A key with the mouse, the symbol A is displayed in the field above (as a string)?