$ npm i stukjs --save
<script src="https://unpkg.com/stukjs@latest/Stuk.js"></script>
Pass an object containing all the variables that will be used by the page to stuk.bindpage()
, and then add the stuk
attribute to elements that should bind to a variable. The value passed to the stuk
attribute should be an existing key in the object passed to stuk.bindpage()
.
Changes to the bound variable's value will be reflected in the page, and changes made to the bound element's value will also propagate back to the script.
<input stuk="name">
<script>
Stuk.bindPage({name:"Benedetti"});
</script>
this code was based on: wintellect.