1) the label: {div {@ id="label"} There have been no clicks yet } 2) the button: {input {@ type="button" value="click me" onclick="CLICKAPP.inc()" }} 3) the script: {script °° code °°} where code is a single function: var CLICKAPP = (function() { var counter = 0; var inc = function() { counter++; getId('label').innerHTML = 'There are ' + counter + ' clicks now'; }; return {inc:inc} })();