Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the document</title> </head> <body> <script> customElements.define('site-info', class extends HTMLElement { connectedCallback() { setTimeout(() => alert(this.innerHTML)); // W3Docs } }); </script> <site-info>W3Docs</site-info> </body> </html>