In general, this is the case: it is necessary to create a page with a background of any color, when clicking to any area of which the painting of a certain size is performed.
Here is the actual code itself:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Page</title> <script type = "text/javascript" src="jquery-3.3.1.js"></script> <link rel="stylesheet" href="style.css"> </head> <body> <form> <div id="myCanvas" width="300"; height="300"; background-color: blue></div> <script type="text/javascript"> $('body').click(function(){ let c = document.getElementById("myCanvas"); let ctx = c.getContext("2d"); ctx.fillRect(20, 20, 150, 100); }); </script> </form> </body> </html>
Screenshot:
править
, click on it and complete the question - michael_best