<repo_name>iammaria/Calculator<file_sep>/index.html
<!DOCTYPE html>
<html>
    <script src="handler.js"></script>
    <link rel="stylesheet" type="text/css" href="style.css" />
    <head>
        <title>Simple Calculator</title>
    </head>
    <body>
        <h1>Calculator</h1>
        <h4>Put the first number in the field:</h4>
        <input placeholder="Please, put any number" id=num1 />  
        <h4>Put the second number in the field:</h4>
        <input placeholder="Please, put any number" id=num2 /> 
        <h4>Choose the operator:</h4>
        <button onclick="myFunction(id)" id=sum>+</button>
        <button onclick="myFunction(id)" id=substract>-</button>
        <button onclick="myFunction(id)" id=multiply>*</button>
        <h4>Operation result:</h4>
        <h3 id=result></h3>
    </body>
</html><file_sep>/README.md
# Calculator

A basic calculator that can add, subtract, and multiply up to two whole numbers
<file_sep>/handler.js
function myFunction(clicked_id){
    const errorMessage = 'Please, put only numbers';
    var displayResult = document.getElementById("result");
    var result;
    displayResult.innerText = "";
    var num1 = Number(document.getElementById("num1").value);
    var num2 = Number(document.getElementById("num2").value);

    if (Number.isNaN(num1) || Number.isNaN(num2)) {
        displayResult.style.color="red";
        displayResult.append(errorMessage);
        return; 
    }

    // get sum of elements
    if (clicked_id === "sum"){
        result = num1 + num2;
    }

    // get subtraction of elements
    if (clicked_id === "substract"){
        result = num1 - num2;
    }

    // get multiplication of elements
     if (clicked_id === "multiply"){
        result = num1 * num2;
     }


    displayResult.append(result);
}