Here is my code snippet for creating an HTML canvas:
<canvas id="glCanvas" class="canvases" width="20" height="20></canvas>
To set the color, I am using the following:
gl.clearColor(0.0, 0.0, 0.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT);
I am wondering if there is a way to dynamically add and remove borders when a specific condition is met during runtime. For example, adding a red border around the canvas when an if-statement is true, and removing it when the condition changes. Can this functionality be achieved using CSS, JavaScript, or WebGL?
Appreciate any guidance on this matter.