JSFiddle - React, Tailwind, and code Playground

by bohdantheone

HTML

<html>
<head>
<script>
function changeResult(result){
  document.getElementById('result').innerHTML = result;
}

function calculateForm(){
  var from=document.getElementById('from').value;
  var to=document.getElementById('to').value;
  var result = (Math.log(Math.exp(to))-Math.log(Math.pow(to,2)))*(from-to);
      
  changeResult(result);
}
</script>
</head>
<body>
<!-- форма -->
<form name="calculator" method="post" >
<input type="text" name="number" id="from" size=20 value="10">
<input type="text" name="number" id="to" size=20 value="20">
</form>
<input type="button" onClick="calculateForm();" style="cursor:hand;cursor:pointer;" value="Розрахувати">
<div id="result"></div>
</body>
</html>

JavaScript

/*var result = (Math.pow(to, 2)-15)/from;
var result = (Math.log(to)*Math.pow(to, 3))-Math.pow(from, 2);
var result = (Math.log(Math.exp(to))-Math.log(Math.pow(to,2)))*(from-to);
var result = (Math.sqrt(Math.pow(to,2))+Math.exp(Math.pow(to,3))/from;
var result = (Math.pow(to, 2)-15)/from;
var result = (Math.pow(to, 2)-15)/from;
var result = (Math.pow(to, 2)-15)/from;
var result = (Math.pow(to, 2)-15)/from;
var result = (Math.pow(to, 2)-15)/from;
var result = (Math.pow(to, 2)-15)/from;*/