Multiplying 2 Numbers

<!-- function is called here -->
<button id="enter" onclick="print(a,b)">Multiply</button> 
<p id="result"></p>
<!-- javascript -->
<script>
    function print(a,b) {
        document.getElementById("result").innerHTML = a * b // math
    }
    // variables are defined
    var a = 1
    var b = 2
</script>