'How to make new canvases on button click in Javascript and HTML

So I have these buttons: https://i.stack.imgur.com/qc90A.png Everytime I click on each button I want to make a new canvas with +1 z-index. I do not know how to make and use dynamic variables.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source