Code
Execute
<!DOCTYPE html> <html> <head> <title>HTML Canvas Tag</title> </head> <body> <h3>WIKITECHY CANVAS </h3> <canvas id="mytechCanvas"> </canvas> <script> var a=document.getElementById('mytechCanvas'); var wiki=a.getContext('2d'); wiki.fillStyle='purple'; wiki.fillRect(0,0,100,200); </script> </body> </html>
Result