htmlcollection Questions

7

Solved

I have some Javascript code to remove an item from a HTMLCollection as in code below. I get an error when splice is called that says: allInputs.splice is not a function. I need to remove items from...
Behavior asked 18/5, 2016 at 22:17

7

Solved

Converting my JS to TS strict mode. The following syntax looks fine to me but TS is complaining in the for loop on allSubMenus with: [ts] Type 'NodeListOf<Element>' is not an array type or a ...

1

I want to get all the HTML elements with the class "Box" and then that collection convert it to an Array so i can acces each element throught position. This is the code i made: function B...
Ramie asked 8/7, 2021 at 15:21

2

Solved

document.scripts returns an HTMLCollection object holding a list of all scripts in a document. Similarly, document.getElementsByTagName("script") returns another HTMLCollection object hol...
Pyrethrum asked 10/10, 2020 at 8:58

4

Solved

In ES6, an iterable is an object that allows for... of, and has a Symbol.iterator key. Arrays are iterables, as are Sets and Maps. The question is: are HTMLCollection and NodeList iterables? Are ...
Beatabeaten asked 8/7, 2015 at 4:9

3

I have some elements in my HTML with class node-item, I access them in my component using: let nodeItems = document.getElementsByClassName('node-item'); and when I log nodeItems it gives m...
Cordes asked 21/4, 2018 at 13:15

4

Solved

I was looking up how to iterate NodeLists and I came across the following bit of code. var nodesArray = Array.prototype.slice.call(nodeList); nodesArray.forEach(function(node) { //... }) ...
Evidentiary asked 20/2, 2014 at 22:40

2

Solved

DOM4 makes NodeLists iterable: interface NodeList { getter Node? item(unsigned long index); readonly attribute unsigned long length; iterable<Node>; }; According to WebIDL, this means ...
Repository asked 20/1, 2017 at 8:18

1

Solved

In my JavaScript, I have two elements. I have logged the two elements and it shows the following: Element 1: Element 2: The problem is: When I console.log the children of each element (ele...
Thee asked 29/7, 2016 at 14:3

3

Solved

test.html <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> ...
Barham asked 26/8, 2015 at 9:2

3

Solved

I wrote a function to change the class of elements to change their properties. For some reason, only some of the elements have changed. It took me a few hours to find a solution, but it seems odd t...

1

Solved

I tried my Google-fu but I can't seem to find any good answer to that question. Please help. EDIT: Ok so I found this blog post. So they come from different DOM levels, but besides that it d...
Stickseed asked 26/3, 2013 at 0:38
1

© 2022 - 2024 — McMap. All rights reserved.