0

Nothing is drawn in canvas while adding some content to parent element

I've working on a sample article. I was adding a canvas element inside a div element. And drawn some rectangles. After that I added some text in the same div container and the drawings were lost. Why? Code: https://code.sololearn.com/W762CeIpOCmS/?ref=app

15th Sep 2020, 12:22 PM
Roopesh
Roopesh - avatar
3 ответов
15th Sep 2020, 12:24 PM
Roopesh
Roopesh - avatar
0
Mirielle[ InAcTiVe ] do you know why the drawings are disappeared when content is directly added via innerHTML? edit: thanks for a relevant answer ☺️
15th Sep 2020, 12:30 PM
Roopesh
Roopesh - avatar