Canvas Lineto
π
2026-06-14 | π HTML
## HTML Canvas lineTo() Method
The `lineTo()` method of the Canvas 2D API adds a straight line to the current sub-path by connecting the sub-path's last point to the specified `(x, y)` coordinates.
Note that this method only defines the path of the line; it **does not** actually draw the line on the canvas. To render the path visually, you must call the `stroke()` or `fill()` method.
---
## Browser Support
The `lineTo()` method is widely supported across all modern web browsers:
* Google Chrome
* Microsoft Edge / Internet Explorer 9+
* Mozilla Firefox
* Safari
* Opera
*Note: Internet Explorer 8 and earlier versions do not support the `