<button type="button" id="sec">Calculate</button>
<input id="a-side" class="input-a" type="number"/>
<script>
var ab = document.getElementById("a-side");
var a = ab.value;
var ui = document.getElementById("sec");
ui.addEventListener('click', function(){
alert(a)
} );
</script>