Don't call your function "evaluate" - it gets confused with document.evaluate:
<div align="center" id="div1">
<input type="text" id="textval" /><br>
<input type="button" value="+" onclick="display('+')" />
<input type="button" value="1" onclick="display('1')" />
<input type="button" value="2" onclick="display('2')" />
<input type="button" value="3" onclick="display('3')" />
<input type="button" value="c" onclick="clr()"/><br>
<input type="button" value="-" onclick="display('-')" />
<input type="button" value="4" onclick="display('4')" />
<input type="button" value="5" onclick="display('5')" />
<input type="button" value="6" onclick="display('6')" /><br>
<input type="button" value="*" onclick="display('*')" />
<input type="button" value="7" onclick="display('7')" />
<input type="button" value="8" onclick="display('8')" />
<input type="button" value="9" onclick="display('9')" /><br>
<input type="button" value="/" onclick="display('/')" />
<input type="button" value="." onclick="display('.')" />
<input type="button" value="0" onclick="display('0')" />
<input type="button" value="=" onclick="getResult()" />
</div>
<script>
function display(val) {
document.getElementById("textval").value += val;
}
function getResult() {
let x = document.getElementById("textval").value;
let y = eval(x);
document.getElementById("textval").value = y;
}
function clr() {
document.getElementById("textval").value = ""
}
</script>
Should work.