-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathbutton.html
More file actions
33 lines (31 loc) · 1.13 KB
/
button.html
File metadata and controls
33 lines (31 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!doctype html>
<html>
<head>
<title>HyperHTMLElement Custom Elements BuiltIn</title>
<script>if(this.customElements)try{customElements.define('built-in',document.createElement('p').constructor,{'extends':'p'})}catch(a){document.write('<script src="//unpkg.com/@ungap/custom-elements-builtin"><'+'/script>')}else document.write('<script src="//unpkg.com/document-register-element"><'+'/script>');</script>
<script src="../min.js"></script>
<script>
//*
class HyperTest extends HyperHTMLElement {
created() { alert(this.outerHTML); }
}
//*/
/*
function HyperTest(node) {
var constructor = HyperHTMLElement.bind(this, node);
var self = new constructor;
return Object.setPrototypeOf(self, HyperTest.prototype);
}
Object.setPrototypeOf(HyperTest, HyperHTMLElement);
Object.setPrototypeOf(HyperTest.prototype, HyperHTMLElement.prototype);
HyperTest.prototype.created = function () {
alert(this.outerHTML);
};
//*/
HyperTest.define('hyper-test', {extends: 'button'});
</script>
</head>
<body>
<button is="hyper-test">hello</button>
</body>
</html>