Posted By

matthalliday on 02/24/10


Tagged

jquery language


Versions (?)

Add a language class name


 / Published in: jQuery
 

If body has lang="fr" then add a special class.

We can't use the CSS pseudo selector :lang(fr) because there is currently no support in Safari.

  1. $('body[lang=fr]').addClass('french');

Report this snippet  

You need to login to post a comment.