1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<!DOCTYPE html> <html lang="en-US"> <head> </head> <body> <x-foo></x-foo> <script> var prototype = Object.create(HTMLElement.prototype); prototype.createdCallback = function() { createdCallbackCalled = true; } document.registerElement('x-foo', {prototype: prototype}); </script> </body> </html>