diff --git a/session_3/index.html b/session_3/index.html index 1fc0f23..b81c6d6 100644 --- a/session_3/index.html +++ b/session_3/index.html @@ -32,7 +32,7 @@

Gasoline price

- +

diff --git a/session_3/main.js b/session_3/main.js index 9dbd211..fd19942 100644 --- a/session_3/main.js +++ b/session_3/main.js @@ -1,3 +1,5 @@ +const calcButton = document.querySelector('#calc'); + const calcGasoline = (e) => { e.preventDefault(); const price = Number(document.getElementById('price').value); @@ -18,6 +20,8 @@ const calcGasoline = (e) => { document.querySelector('#answer').textContent = 'something'; }; +calcButton.addEventListener('click', calcGasoline); + const tempConventer = (id, value) => { const val = parseFloat(value);