My html code below should display a button for the colors green and red but they are not displaying, I do however see the buttons for clear canvas and howdy. any help on what is wrong? I would ultimately like when the buttons are pushed to changed the color of the line that is beign drawn on the canvas, I fanyone knows how ti implement in Javascript code that owuld be helpful. I’m very new to this.
<title>Paint Canvas</title>
</head>
<body>
<div id="container">
<canvas id="imageView" width="600" height="300">
<input type= "button" value= "Green" id= "green" onclick= "GreenRect()" />
<input type= "button" value= "Red" id= "red" onclick= "RedRect()" />
</p>
</canvas>
</div>
<script type="text/javascript" src=".js"></script>
</body>
</html>
<body >
<button id="clear">Clear Canvas</button><br>
<button id="howdy">Howdy!</button><br>
</body>
Your buttons should be below canvas in you code, just because canvas ignore all content within opening and closeing tags.
You can style your buttons position to have overlayed canvas.
Btw. you have double
<body>tag in your code.