Files
web-components-workshop-dep…/index.html
Julien Lengrand-Lambert 4ac8d920d6 Creates first custom element
Also updates README
2017-11-22 17:38:23 +01:00

24 lines
648 B
HTML

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>WebComponents workshop</h1>
<p>In this workshop, we will create new custom HTML Components</p>
<hello-world></hello-world>
<button onclick="removeHelloWorld()">Click me</button>
<script src="src/components/hello-world.js"></script>
<script>
function removeHelloWorld(){
console.log("Called!");
const helloElement = document.getElementsByTagName("hello-world")[0];
helloElement.parentNode.removeChild(helloElement);
}
</script>
</body>
</html>