Here is the example of button click Example javascipt
<button onclick="myFun()">Click me</button>
<p id="demo"></p>
<script>
function myFun()
{
document.getElementById("demo").innerHTML="Test";
}
</script>
<button onclick="myFun()">Click me</button>
<p id="demo"></p>
<script>
function myFun()
{
document.getElementById("demo").innerHTML="Test";
}
</script>