Code
Execute
<!DOCTYPE html> <html> <head> <title>Wikitechy HTML Canvas strokeRect with example</title> </head> <h1>HTML Canvas strokeRect with example</h2> <body> <canvas id="wikiCanvas" width="370" height="200" style="border:1px solid green;"> </canvas> <script> var a = document.getElementById("wikiCanvas"); var context = a.getContext("2d"); context.strokeRect(90, 50, 170, 100); </script> </body> </html>
Result