Code
Execute
<!DOCTYPE html> <html> <head> <title>wikitechy-HTML Canvas moveTo() </title> </head> <body> <h1>wikitechy-HTML Canvas moveTo() with example: </h1> <canvas id="wikitechyCanvas" width="400" height="200" style="border:1px solid #d3d3d3;"> </canvas> <script> var d = document.getElementById("wikitechyCanvas"); var dfh = d.getContext("2d"); dfh.moveTo(0, 0); dfh.lineTo(400, 200); dfh.strokeStyle="blue"; dfh.stroke(); </script> </body> </html>
Result