Simple JavaScript In Viewer
function bar()
{
document.getElementById("x").innerText = parseInt(document.getElementById("x").innerText, 10) + 1;
}
function foo()
{
return `<script>${bar}</script>
<h1>
<a href="#" onclick="bar()">Click Me!</a>
<span id = "x">0</span>
</h1>`;
}
foo();
no comments