Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get all classes of element jquery

var classList = $('#divId').attr('class').split(/s+/);
$.each(classList, function(index, item) {
    if (item === 'someClass') {
        //do something
    }
});
 
PREVIOUS NEXT
Tagged: #classes #element #jquery
ADD COMMENT
Topic
Name
6+3 =