+ 1
[solved]Please teach me why property "width" is null?
I'm beginner of programming (and English). I don't know why I could get canvas' width. https://code.sololearn.com/Wct92EwbeVWJ/?ref=app
5 Réponses
+ 4
probably it is treating ”test” as a whole string including those ”” characters as well .
So you need to select id this way ,
document.getElementById("”test”"
Or you could just use right characters (i.e. "test") if you want only test to be interpreted as string.
+ 3
The value for id attribute of the <canvas> is wrapped with slanted quotation marks. This in turn, makes the browser ignores the attribute and its value.
+ 2
// your incorrect code id=”test”
// correct code id="test"
different symbol ” & "
https://code.sololearn.com/WEOdYenUT4HB/?ref=app
+ 1
Thank you for every answers.
I could get property width by erase quotation marks of id="test".