Pibd-22_Presnyakova.V.V_IP/front/script.js
2023-03-27 13:58:35 +04:00

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
})
}