Poor choice of canvas id
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/Path2D/Path2D
What specific section or headline is this issue about?
https://developer.mozilla.org/en-US/docs/Web/API/Path2D/Path2D#examples
What information was incorrect, unhelpful, or incomplete?
Using the id "canvas" (as in <canvas id="canvas"></canvas>) might cause some people to create something like
<div id="canvas"> and then getting the error getContext is not a function when running
const canvas = document.getElementById("canvas");
const ctx = canvas.getContext("2d");
I guess I was not the only one running into this error since this answer on StackOverflow getContext is not a function also got 103 upvotes
What did you expect to see?
<canvas id="myCanvas">
or
<canvas id="canvasArea"> (so that it's different from w3schools)
Do you have any supporting links, references, or citations?
No response
Do you have anything more you want to share?
No response
Thanks for raising this one. I think that's a good idea, would you like to open a PR to fix it?
Ok
Hi, I’d like to work on this issue. Please assign it to me if it’s still available. Thanks!
Hi! I’m new to MDN contributions and I’d like to work on this issue. May I take it?
Hi all, there's already a pull request open to address this:
- [ ] https://github.com/mdn/content/pull/42159
You can follow along on the progress there, thanks!
can you assign this issue to me?