Met Canvas Ispointinpath
# HTML canvas isPointInPath() Method
[ Canvas Object](#)
## Example
If the point 20,50 is within the current path, draw a rectangle:
YourbrowserdoesnotsupporttheHTML5canvastag.
JavaScript:
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.rect(20,20,150,100);
if (ctx.isPointInPath(20,50))
{
ctx.stroke();
};
[Try it Β»](#)
* * *
## Browser Support

The isPointInPath() method is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
**Note:** Internet Explorer 8 and earlier versions do not support the element.
* * *
## Definition and Usage
The isPointInPath() method returns true if the specified point is within the current path, otherwise it returns false.
| JavaScript Syntax: | _context_.isPointInPath(_x,y_); |
| --- |
## Parameter Values
| Parameter | Description |
| --- | --- |
| _x_ | The x-coordinate to test. |
| _y_ | The y-coordinate to test. |
* * Canvas Object](#)
YouTip