blob: 3aabff244855cec72162af84ef7188699ed2a9c1 [file] [log] [blame]
<!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>