Sử dụng thuộc tính innerHTML (hoặc textContent) của phần tử <button> để lấy nội dung hiển thị.
Ví dụ
<!DOCTYPE html>
<html>
<body>
<form id="myForm">
<button id="btn" type="button">My Button</button>
</form>
<script>
var str = document.getElementById("btn").innerHTML;
document.write("Button text: " + str);
</script>
</body>
</html>