summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/custom-elements/v0/resources/register-and-create-custom-element.html
blob: 3aabff244855cec72162af84ef7188699ed2a9c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html>
<html>
<head>
    <title>Register and create custom element</title>
    <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
    <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
</head>
<body>
    <div id="log"></div>
    <script>
        var proto = Object.create(HTMLElement.prototype);
        proto.createdCallback = function() {
            document.querySelector('#log').textContent = 'Created callback was called';
        };
        document.registerElement('x-element', {prototype: proto});
    </script>
    <x-element id="x-element"></x-element>
</body>
</html>