You need to split
that into an array:
console.log(jQuery('selector').attr('class').split(' ')[0]);
More Related Contents:
- jQuery: Finding partial class name [duplicate]
- jQuery match part of class with hasClass
- How to display an chage photo option on mouse hover similar to linkedin using Javascript? [closed]
- How to force browser to show image 3 inches wide?
- HTML Form Submit pass array to PHP [closed]
- Why does jQuery or a DOM method such as getElementById not find the element?
- jQuery click events firing multiple times
- Binding arrow keys in JS/jQuery
- variable === undefined vs. typeof variable === “undefined”
- How to get an AJAX get-request to wait for the page to be rendered before returning a response?
- How to get the containing form of an input?
- Javascript/jQuery: Set Values (Selection) in a multiple Select
- Border Radius for IE8
- How to change color of an image using jquery [closed]
- Jquery .show() not revealing a div with visibility of hidden
- Trees in Twitter Bootstrap [closed]
- Twitter Bootstrap. Why do modal events work in JQuery but NOT in pure JS?
- How to detect a click inside of an iframe (cross-domain)? Aka prevent click fraud
- Customizing the Add/Edit Dialog in jqGrid
- Safari Javascript Date() NaN Issue (yyyy-MM-dd HH:mm:ss)
- Get image width and height from the Base64 code in JavaScript
- Paint algorithm leaving white pixels at the edges when I color [duplicate]
- What is jQuery Unobtrusive Validation?
- How can I get access to a Highcharts chart through a DOM-Container?
- How to get an element by its href in jquery?
- How to negate code in “if” statement block in JavaScript -JQuery like ‘if not then..’
- Keep tabbing within modal pane only
- jQuery InnerText not including sub element
- Looping through Markers with Google Maps API v3 Problem
- Grouping JSON by values