meow

mail@pastecode.io avatar
unknown
javascript
2 months ago
370 B
1
Indexable
Never
const skaitlis1 = document.getElementById('skaitlis1'); //ievades lauks 1
const skaitlis2 = document.getElementById('skaitlis2'); //ievades lauks 2
const sum = document.getElementById('sum'); //poga


let str = "Number(skaitlis1.value) + Number(skaitlis2.value)"; // savieno abus lmfao
sum.addEventListener('click', () => { // pogas on click
  alert(eval(str)) //ezez
})
Leave a Comment