HTMLButtonElement: thuộc tính value
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Thuộc tính value của giao diện HTMLButtonElement đại diện cho giá trị của phần tử <button> dưới dạng chuỗi, hoặc chuỗi rỗng nếu chưa đặt giá trị. Nó phản ánh thuộc tính value của phần tử.
Giá trị
Một chuỗi chứa giá trị của phần tử <button>.
Ví dụ
js
const buttonElement = document.getElementById("given-name");
console.log(`value: ${buttonElement.value}`);
Đặc tả kỹ thuật
| Thông số kỹ thuật |
|---|
| HTML> # dom-button-value> |