Actually I don't understand why we include JS in html . | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
- 1

Actually I don't understand why we include JS in html .

I didn't mean why we use javascript in html without using it individually.I meant why we include some of JS in html5 in the <canvas> tag.

9th Jan 2019, 3:41 PM
šŸ‡®šŸ‡±šŸ‡®šŸ‡³šŸ–„Paul the coderšŸ‡®šŸ‡±šŸ‡®šŸ‡³šŸ’»
šŸ‡®šŸ‡±šŸ‡®šŸ‡³šŸ–„Paul the coderšŸ‡®šŸ‡±šŸ‡®šŸ‡³šŸ’» - avatar
1 Resposta
0
Probably because html is a markup language and not a programming language. The canvas itself needs to be programmed so that's why it needs javascript. If we would use html5 and css instead I'm afraid it would limit the possibilities we have with the canvas tag. Edit: if you look up some canvas demos you would find awesome creations. These simply can't be made with standard html.
2nd Feb 2019, 12:44 PM
Stef Schƶningh
Stef Schƶningh - avatar