Em mới học lập trình javascript. Em có tạo 1 hàm mà bị lỗi ở theKetqua.innerText =tong; e ko b vì sao mn có thể sửa giúp với ạ
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
#soA{
color: red;
}
</style>
</head>
<body>
<input type="text" id="soA">
<input type="text" id="soB">
<button onclick="tinhTong()">Tinh Tong</button>
<h2 id="ketqua"></h2>
<script type="text/javascript">
function tinhTong() {
var theInputA = document.querySelector('#soA');
var theInputB = document.querySelector('#soB');
var theKetqua = document.querySelector('#Ketqua');
var tong = Number(theInputA.value) + Number(theInputB.value);
theKetqua.innerText =tong;
}
</script>
</body>
</html>