added thisthat

This commit is contained in:
didier amyot committed 2024-01-31 20:33:46 -05:00
1 parent 8a72eec139
commit cdf1258831
2 files changed
+60

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<button id="button">boom</button>
<button id="button1">boom</button>
<button id="button2">boom</button>
<button id="button3">boom</button>
<script src="main.js" type="module"></script>
</body>
</html>
+40
View File
@@ -0,0 +1,40 @@
class FatBoom{
word(){
return "boom de fat classe";
}
boom = (evt) => {
alert(this.word())
}
}
class Boom{
word(){
return "boom de classe";
}
boom(evt){
alert(this.word())
}
}
function boom(){
alert("hello world")
}
const fatBoom = () => {
alert("HELLO WORLD")
}
document.getElementById("button")
.addEventListener("click", boom)
document.getElementById("button1")
.addEventListener("click", fatBoom)
document.getElementById("button2")
.addEventListener("click", (new Boom()).boom)
document.getElementById("button3")
.addEventListener("click", (new FatBoom()).boom)