HTMLSelectElement: thuộc tính name
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 name của giao diện HTMLSelectElement cho biết tên của phần tử <select>. Nó phản ánh thuộc tính name của phần tử.
Giá trị
Một chuỗi đại diện cho tên của phần tử.
Ví dụ
js
const selectElement = document.querySelector("#planets");
console.log(`Element's name: ${selectElement.name}`);
selectElement.name = "galaxies"; // sets or updates the element's name
Đặc tả kỹ thuật
| Thông số kỹ thuật |
|---|
| HTML> # dom-fe-name> |