+ 2
Why the text is not showing in the canvas
What was wrong in JavaScript code .See it in my code link and tell me what was wrong in the code https://code.sololearn.com/WfF1lHo3Sc52/?ref=app
3 odpowiedzi
+ 5
'font' is a property, not a method, and there's a comma missing between string and numeric arguments inside the fillText() call:
var pati=document.getElementById("pokhi");
var paduri=pati.getContext("2d");
paduri.font = "20px";
paduri.fillText("My Canvas",10,20);
+ 2
You have error on line 9 & 10:
Line 9: you forgot = after font
paduri.font=("20px")
Line 10:you forgot , after "My canvas" text;
paduri.fillText("My Canvas" ,10,20);
+ 1
Sudarshan Rai 👑 visph thanks for your answer. I understand what was wrong