UNPKG
domassist
Version:
latest (2.3.2)
2.3.2
2.3.1
2.3.0
2.2.0
2.1.0
2.0.3
2.0.2
2.0.1
2.0.0-rc.2
2.0.0-rc.1
2.0.0-rc.0
1.13.1
1.13.0
1.12.0
1.11.1
1.11.0
1.10.0
1.9.1
1.9.0
1.8.0
1.7.2
1.7.1
1.7.0
1.6.1
1.6.0
1.5.0
1.4.1
1.3.3
1.3.2
1.3.1
1.3.0
1.2.0
1.1.0
1.0.1
Various dom helpers
github.com/firstandthird/domassist
firstandthird/domassist
domassist
/
lib
/
hasClass.js
11 lines
(9 loc)
•
200 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
findOne
from
'./findOne'
;
function
hasClass
(
selector, cls
) {
const
el =
findOne
(selector);
if
(!el) {
return
false
; }
return
el.
classList
.
contains
(cls); }
export
default
hasClass;