Phone +491622769240 E-mail tatiana.todoseva@gmail.com Telegram @tatianaDot Discord tatiana_tod Codewars LinkedIn
Tester with 1 year experience in testing. Worked in companies with high growth rates. I’m interested in Java script development and I’d like to develop in this area. Love people and technology. I believe that professionalism is one of the most important qualities of a person.
<script>
function myFunction() {
let operand1 = Number(document.getElementById("operand1").value);
let operand2 = Number(document.getElementById("operand2").value);
let operator = document.getElementById("operator").value;
let errorMessage= document.getElementById("errorMessage");
let result;
if (isNaN(operand1) || isNaN(operand2)) {
errorMessage.textContent = "Please enter correct data";
} else {
errorMessage.textContent = "";
if (operator === "+") {
result = operand1 + operand2;
} else if (operator === "-") {
result = operand1 - operand2;
} else if (operator === "*") {
result = operand1 * operand2;
}
}
document.getElementById("results").textContent = result;
}
</script>