HTMLInputElement: thuộc tính placeholder
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 placeholder của giao diện HTMLInputElement đại diện cho một gợi ý cho người dùng về những gì có thể nhập vào điều khiển. Nó phản ánh thuộc tính placeholder của phần tử <input>.
Giá trị
Một chuỗi.
Ví dụ
js
const inputElement = document.getElementById("phone");
console.log(input.placeholder);
Đặc tả kỹ thuật
| Specification |
|---|
| HTML> # dom-input-placeholder> |
Tương thích trình duyệt
Xem thêm
<input>HTMLInputElement.value- Phần tử giả
::placeholder - Lớp giả
:placeholder-shown