18 lines
517 B
JavaScript
18 lines
517 B
JavaScript
'use strict'
|
|
|
|
|
|
|
|
function getResult() {
|
|
let num1 = document.getElementById("input1").value
|
|
let num2 = document.getElementById("input2").value
|
|
let operator = document.getElementById("operator").value
|
|
let result = document.getElementById("result")
|
|
let type = document.getElementById("Type").value
|
|
fetch(`http://localhost:8080/${operator}?Type=${type}&value1=${num1}&value2=${num2}`)
|
|
.then(response => response.text())
|
|
.then(data => {
|
|
result.value = data
|
|
})
|
|
|
|
}
|