Let’s say the body tag has a few class attributes:
<body class="html logged-in frontpage no-sidebar">
...
</body>
Currently, I use jQuery to get all class attributes of body tag using:
$('body').attr('class');
I want to get the very beginning/first class attribute (which is ‘html’ class here).
How?
You could also use plain old javascript (see Vega’s answer)