<input value="180 - 20%"/>
<button>click</button>
<script>
document.querySelector("button").addEventListener("click", function () {
var value = document.querySelector("input").value;
var mas = value.match(/\d+/g);
var omen = value.match(/[^\d\s]/)[0];
var result = eval(mas[0] + omen + ((mas[0]/100) * mas[1]));
alert(result);
});
</script>