functioncount(){ var hamPrice = 50; var cokePrice = 20; var hamNum = parseInt(document.getElementById('hamNumId').value); var cokeNum = parseInt(document.getElementById('cokeNumId').value); var total = (hamNum*hamPrice) + (cokeNum*cokePrice); document.getElementById('totalId').textContent = total; } var el = document.getElementById('countId'); el.addEventListener('click',count,false);