
1177.11 Textures and Render-to-Texture
Even without extra packages, it is very simple to bring in basic interactive devices
including menus, sliders, text boxes, and buttons with just HTML and JS. For example a
button for a toggle can be done with one line in the HTML le:
<button id = "myButton">A Toggle</button>
and in the JS le we change a Boolean variable toggle by
var a = document.getElementById("myButton");
a.addEventListener("click", function(event){toggle = !toggle;});
In fact, we can do the equivalent with just a single line in the HTML, le but we prefer
to separate the page description from the action.
A slider is almost as simple. H