Deff,
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
var static = 'a1';
var cl2 = $.trim($("div."+static)[0].className.replace(static,''));
alert(cl2);
});
</script>
</head>
<body>
<div class="a1 b2">class="a1 b2"</div>
</body>
</html>