Jerpl Jerpl - 2 months ago 5
CSS Question

Append declared language to html?

How could I add 'lang="en"' to the end of my opening html tag? I can't just write it in there manually as I don't have access to it (ecommerce package), but I'd like to be able to declare the site language somehow.


You can change the attributes of any element using .attr()


With plain JS, you can also access the <html> element with the documentElement:

document.documentElement.lang = 'en';