QQrebzya,
</!DOCTYPE html>
<html>
<head>
<meta charset= "UTF-8"/>
<title>Lessons</title>
<link rel="stylesheet" type="text/css" href="test.css">
</head>
<body>
<input id="now" type="number" placeholder="Стало" step="any">
<input id="was" type="number" placeholder="Было" step="any">
<input id="calc" type="button" value="Посчитать">
<script >
var someFunc = function(){
var now = +document.getElementById("now").value||0; // Цена на данный момент
var was = +document.getElementById("was").value||0; // Цена до изменения
var wasInPercent = was / 100;
var difference = was - now;
var changeInPercent = (difference / wasInPercent)||0;
alert(changeInPercent);
console.log(now);
console.log(was);
console.log(difference);
console.log(wasInPercent);
console.log(changeInPercent);
}
document.getElementById("calc").onclick = someFunc;
</script>
</body>
</html>