Created
April 16, 2019 23:58
-
-
Save pbuzdin/75197d56187cdd8ca974db4ccefabe0e to your computer and use it in GitHub Desktop.
regular-elements test // source https://jsbin.com/kubokak
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>regular-elements test</title> | |
</head> | |
<body> | |
<button class="hi-five clicker">hui</button> | |
<script src="https://unpkg.com/regular-elements"></script> | |
<script> | |
//this.onload = function (){ | |
function theClicker() { | |
console.log('You Clicked!'); | |
} | |
regularElements.define('.clicker', { | |
onconnected: function () { | |
this.addEventListener('click', theClicker); | |
} | |
}); | |
regularElements.define('.hi-five', { | |
onconnected: function () { | |
this.textContent += ' 🖐 '; | |
} | |
}); | |
//}; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment