question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can we use Element.classList or not?

See original GitHub issue

I just want to ask whether we use Element.classList or not. Cross-browser support is not perfect but it should be good enough.

I’m asking because I thought that we don’t use .classList but plugins like Line numbers are sending mixed messages, so I’m not sure.

/cc @mAAdhaTTah

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Golmotecommented, Apr 22, 2019

True, but I’m not a fan of adding polyfills to core features. If we are to drop old IE compatibility then we don’t have to bother too much about this (but we could list this polyfill in an appropriate section of the readme). And if we were to keep old IE compatibility, adding this polyfill would still require a major version bump.

1reaction
Golmotecommented, Apr 22, 2019

Oh, and now I just saw an issue where we speak about dropping IE11 support. Haha we might not be compatible with IE9 at all, actually. I don’t know anymore. A major version with explicit browser support (at least in the readme) would be great.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Element.classList - Web APIs | MDN
classList is a read-only property that returns a live DOMTokenList collection of the class attributes of the element. This can then be used...
Read more >
HTML DOM Element classList Property - W3Schools
The classList property returns the CSS classnames of an element. ... The classList property is read-only, but you can use the methods listed...
Read more >
Check If an Element contains a Class - JavaScript Tutorial
This tutorial shows you how to check if an element contains a specific class using JavaScript DOM API.
Read more >
Literally Everything You Need To Know About classList
JavaScript classList seems straightforward, but there are actually multiple unique methods you probably don't know.
Read more >
Check if an element contains a class in JavaScript?
Use element.classList .contains method: element.classList.contains(class);. This works on all current browsers and there are polyfills to support older ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found