-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindexJS.html
More file actions
82 lines (63 loc) · 2.18 KB
/
indexJS.html
File metadata and controls
82 lines (63 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script>
//document.addEventListener('DOMContentLoaded', function () {
// //Recuperation d'une div
// var div = document.querySelector("div");
// //div.innerText = "<strong>Hello javascript !!</strong>";
// div.innerHTML = "<strong>Hello c# !!</strong>";
// div.id = "myDiv";
// console.log(div);
//});
document.addEventListener("DOMContentLoaded", onDOMLoaded);
function onDOMLoaded() {
var divs = document.getElementsByTagName("div");
divs[0].innerText = "Named function";
divs[0].style.backgroundColor = "rgb(63, 239, 255)";
divs[0].style.transform = "rotate(45deg) translateY(300px) scale(0.5)";
console.log(this);
var that = this;
document.querySelector('button').addEventListener("click", (event) =>{
console.log(event);
});
function myFunc(valeur, callback) {
//"use strict";
//debugger
//console.log(arguments);
//if (callback.caller.length > 0)
// callback(valeur);
//else
// callback();
}
myFunc(100, (x) => { console.log(x * 2); });
myFunc(100, (x) => {
console.log("Suppppper on additionne");
console.log(x + 300);
})
function test() {
if (arguments.length > 0)
console.log(arguments[arguments.length - 1]);
}
test();
test(1000)
function direBonjour() {
if (arguments[0] != undefined) {
console.log(arguments[0]);
}
else {
console.log("Hello");
}
}
direBonjour();
direBonjour("Bonjour a moi meme");
}
</script>
</head>
<body>
<div></div>
<button onclick=""></button>
</body>
</html>