|
|
|
|
|
by andybak
3666 days ago
|
|
That page does an excellent job of convincing me to carry on using jQuery. if (el.classList)
el.classList.contains(className);
else
new RegExp('(^| )' + className + '( |$)', 'gi').test(el.className);
vs $(el).hasClass(className);
<shivers> |
|
The point is that this site explains how you do it because a) that's probably easier than trawling through the jquery source b) including this polyfill when you know you need it might save you from requiring all the rest of jquery.