Prev Demo
Clearrect()
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <body> <canvas id="myCanvas" width="200" height="100" style="border:4px solid pink;"> </canvas> <script> var a = document.getElementById("myCanvas"); var b = a.getContext("2d"); b.clearRect(40, 10, 50, 80); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output