S
S
sadbadunicorn2018-08-21 23:56:52
JavaScript
sadbadunicorn, 2018-08-21 23:56:52

classList not working in IE11, what can be done?

In other browsers everything works, in IE11 it reaches the line and issues: Failed to get the "classList" property of a link whose value is undefined or NULL , please help me how to deal with it. In all other browsers everything works fine.
cards[i].classList.toggle('selected');

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
lloydbanks, 2018-08-22
@lloydbanks

Try this polyfill

A
Alexander Taratin, 2018-08-22
@Taraflex

Back to top head

<meta http-equiv="X-UA-Compatible" content="IE=edge">

M
Moses Fender, 2019-02-16
@mosesfender

Here you need to look up what is inherited from what. Does cards[i] have prototypes?
In normal browsers, classList appears on Element. At microsoft splint - in HTMLElement. Therefore, an object that inherits from Element does not have a classList. For example, SVGSVGElement.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question