mirror of
https://github.com/jlengrand/web-components-workshop-deprecated.git
synced 2026-03-10 08:51:23 +00:00
24 lines
648 B
HTML
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> |