Add a language class name

/ Published in: jQuery
Save to your folder(s)

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.

Copy this code and paste it in your HTML
  1. $('body[lang=fr]').addClass('french');

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.