Skip to content

Instantly share code, notes, and snippets.

@pbuzdin
Created April 16, 2019 23:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbuzdin/75197d56187cdd8ca974db4ccefabe0e to your computer and use it in GitHub Desktop.
Save pbuzdin/75197d56187cdd8ca974db4ccefabe0e to your computer and use it in GitHub Desktop.
regular-elements test // source https://jsbin.com/kubokak
<!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