[jQuery] Put attribute value in class

[jQuery] Put attribute value in class


Hi,
I'm trying to put an attribute value as a class in my element:
HTML:
<ul>
<li lang="en">text</li>
<li lang="nl">text</li>
<li lang="it">text</li>
</ul>
jQuery:
$("li").each(function(){
    var lang = $('#language a[@lang]');
    $(this).addClass(lang);
});
Which gives an error about c.split not being a function. Quoting lang
sets all classes to lang. Anybody got a cluebat for me?
Thanks!