lang + title CodePen overrides both. The JS now detects if it's running inside an iframe (window.self !== window.top) and sets them on the real document. When you open the file directly in a browser, the HTML attributes work as normal and the JS does nothing. Skip link href="#main" doesn't work in CodePen's iframe. Now the click is intercepted with JS — it finds #main, gives it tabindex="-1" so it can receive programmatic focus, calls .focus(), then removes the tabindex once focus leaves so it doesn't linger in the tab order.
Top comments (0)