HTML DOM NodeList keys() Method
- Nakaraang pahina item()
- Susunod na pahina length
- Bumalik sa itaas na antas HTML DOM NodeList
Definition and Usage
The keys() method returns an Iterator that contains the keys of the NodeList.
Example
Example 1
List the keys of the document's child nodes:
const list = document.body.childNodes; for (let x of list.keys()) { text += x; }
Example 2
List the child nodes of the document:
const list = document.body.childNodes; for (let x of list.values()) { text += x; }
Syntax
nodelist.keys()
Parameters
No parameters.
Return Value
Type | Description |
---|---|
Object | Iterator object na may mga susunod na salita ng listahan. |
Browser Support
nodelist.keys() ay DOM Level 4 (2015) na katangian.
Lahat ng modernong browser ay sumusuporta sa ito:
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Supported | Supported | Supported | Supported | Supported |
Internet Explorer 11 (o mas maaga na bersyon) ay hindi sumusuporta sa nodelist.keys().
Related Pages
- Nakaraang pahina item()
- Susunod na pahina length
- Bumalik sa itaas na antas HTML DOM NodeList