Q:

jQuery - if two classes - get the first one

Example:
Here we have <p class="tab1 current"></p>
How can I get only the first class?
var GetFirstClass = $('p').attr('class').filter(':first'); ??
Any help much appreciated. 

A:

Use JavaScript's split function:
$('p').attr('class').split(' ')[0]

Demo

A:

$('p').attr('class').split(' ')[0]

