i have a <div> like this.
<div id="div" class="a b _c d _e f"></div>
how can convert classes of <div> to a javaScript array?
var cls = $('#div').attr('class');
cls = $(cls).match(/_\S+/g).join(" "); //separate classes are begin with underScore.
cls = $(cls).toArray();
but this doesn't work.
$(cls).matchis wrong because.match()is defined forStringtype, so it should becls = cls.match(/_\S+/g)<div>has classes that begin with underScore, A condition run.