S2
jS
Learn
Create Your Own
Split Screen
Go to Live Site
Next Page
You can also convert to
upper
or
lower
case.
<HTML> <body> <canvas id=myCanvas height=200 width=200 style="background-color: khaki"> </canvas> <script> var ctx = myCanvas.getContext("2d"); var name = "Jonathan Swift"; ctx.font="15px arial"; ctx.fillText("Name: " + name, 0, 20); ctx.fillText("Name: " + name.toUpperCase(), 0, 40); ctx.fillText("Name: " + name.toLowerCase(), 0, 60); </script> </body> </html>