Reputation: 7559
I try to modify <canvas>
in realtime so I can learn fast, but because the code is used in the <script>
so when I try to modify the code it dident get updated as i did with HTML or with the CSS.
How to make it update in real time?
Upvotes: 0
Views: 187
Reputation: 187034
Code doesn't work like CSS or HTML (which is markup, not code, and it has a constant effect on the page). Your code is executed on page load, and if you change the code in the dev tools after it's run it's not going to un-execute your code so it can run the changed version.
At least not from the dev tools. Instead I recommend something like LiveReload which can watch for when you save files and then make your browser refresh itself.
Upvotes: 2