+ 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 Answers
+ 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".