I am making a JavaScript code that solves the midpoint formula when you give it inputs but when it gives me the answer the numbers are not what they are supposed to be! I have checked everything and it should work fine, but it doesn't. Here is the code,please help me:
<!DOCTYPE html>
<html>
<head>
<style>
</style>
<script>
function myFunction() {
var xone = document.getElementById("x1").value;
var yone = document.getElementById("y1").value;
var xtwo = document.getElementById("x2").value;
var ytwo = document.getElementById("y2").value;
var step1 = (xone + xtwo) / 2;
var step2 = (yone + ytwo) / 2;
alert("(" + step1 + "," + step2 + ")");
}
</script>
</head>
<body>
<span>x1</span>
<input type="text" id="x1"></input><br>
<span>y1</span>
<input type="text" id="y1"></input><br>
<span>x2</span>
<input type="text" id="x2"></input><br>
<span>y2</span>
<input type="text" id="y2"></input><br>
<button onclick="myFunction()">Go</button>
</body>
</html>