S2
jS
Learn
Create Your Own
Split Screen
Go to Live Site
Next Page
To change the colour of filled text, you set the fillStyle in the usual way.
<HTML> <head> <title> My new Web Page </title> </head> <body> <canvas id=myCanvas width=300 height=300 style="background-color: pink;"> </canvas> <script> var ctx = myCanvas.getContext("2d"); ctx.font= "60px Arial"; ctx.fillStyle = "green"; ctx.fillText("Hello", 10, 50); </script> </body> </html>