Other / Validation / Language Check
The Language Check bookmarklet reports the page's primary language and identifies elements with different language attributes. Extracts the `lang` attribute from the document element, finds all elements with their own `lang` attribute that are direct descendants (not nested inside other lang elements), and displays an alert showing the page language and a list of any element-level language declarations. Useful for verifying proper language markup when content changes languages.
WCAG SC 3.1.1: Language of PageWCAG SC 3.1.2: Language of Parts
Run Language Check
Test run or drag to
bookmarklets bar to install
javascript:%21function()%7B%22use%20strict%22%3Btry%7Bconst%20e%3Ddocument.documentElement.getAttribute(%22lang%22)%7C%7C%22(none)%22%2Cn%3D%5B...document.querySelectorAll(%22%5Blang%5D%22)%5D.filter(e%3D%3Ee.closest(%22%5Blang%5D%22)%3D%3D%3De).map(e%3D%3E%60%24%7Be.tagName.toLowerCase()%7D%20lang%3D%22%24%7Be.getAttribute(%22lang%22)%7D%22%60)%3Balert(%22Page%20lang%3A%20%22%2Be%2B%22%5CnTop-level%20elements%20with%20lang%3A%20%5Cn%22%2B(n%5B0%5D%3Fn.join(%22%5Cn%22)%3A%22(none)%22))%2Cconsole.log(%22%5CnSource%3A%20https%3A%2F%2Fgithub.com%2Falejandrogiga98%2FA11y-Bookmarklets%5CnBookmarklet%20name%3A%20Language%20check%5CnAuthor%3A%20alejandrogiga98%5CnLicense%3A%20MIT%20License%5Cn%22)%7Dcatch(e)%7Balert(%22Bookmarklet%20Error%3A%20%22%2Be.message)%7D%7D()%3B
← Back to all bookmarklets