Feat(NSI): ajoute le deuxième exercice
This commit is contained in:
3
1NSI/08_Interaction_web/script/1E_boucles.js
Normal file
3
1NSI/08_Interaction_web/script/1E_boucles.js
Normal file
@@ -0,0 +1,3 @@
|
||||
for (let i = 5; i<10; i++){
|
||||
console.log("allez " + i);
|
||||
}
|
8
1NSI/08_Interaction_web/script/1E_condi.js
Normal file
8
1NSI/08_Interaction_web/script/1E_condi.js
Normal file
@@ -0,0 +1,8 @@
|
||||
let age = prompt("Quel age as tu?")
|
||||
if (age === 10) {
|
||||
console.log("Tu as 10ans!")
|
||||
} else if (age > 18) {
|
||||
alert("Va voter!")
|
||||
} else {
|
||||
console.log("C'est pour bientot")
|
||||
}
|
5
1NSI/08_Interaction_web/script/1E_fonction.js
Normal file
5
1NSI/08_Interaction_web/script/1E_fonction.js
Normal file
@@ -0,0 +1,5 @@
|
||||
function vousAlerte(texte) {
|
||||
alert("Je vous alerte!")
|
||||
alert(texte)
|
||||
}
|
||||
vousAlerte("Regarde derrière toi!")
|
@@ -1,11 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<title> "Languages" </title>
|
||||
<title> "Langages" </title>
|
||||
<meta charset="utf-8">
|
||||
<body>
|
||||
<ul id="langages">
|
||||
<li> HTML </li>
|
||||
<li> CSS </li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Langages du web</h1>
|
||||
<ul id="langages">
|
||||
<li> HTML </li>
|
||||
<li> CSS </li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -1,8 +1,8 @@
|
||||
>>> let languages = document.getElementById("languages")
|
||||
>>> languages.style.color = "red"
|
||||
>>> let item1 = languages.children[0]
|
||||
>>> let langages = document.getElementById("langages")
|
||||
>>> langages.style.color = "red"
|
||||
>>> let item1 = langages.children[0]
|
||||
>>> item1
|
||||
>>> item1.innerHTML = 'HTML5'
|
||||
>>> let item3 = document.createElement("li")
|
||||
>>> languages.appendChild(item3)
|
||||
>>> langages.appendChild(item3)
|
||||
>>> item3.innerHTML = "Javascript"
|
||||
|
@@ -1,9 +1,9 @@
|
||||
function apparition(){
|
||||
list.style.visibility = "visible";
|
||||
langages.style.backgroundColor = "white";
|
||||
}
|
||||
function disparition(){
|
||||
list.style.visibility = "hidden";
|
||||
langages.style.backgroundColor = "blue";
|
||||
}
|
||||
list.onmouseover = disparition ;
|
||||
list.onmouseleave = apparition ;
|
||||
list.onclick = function() { alert("Clic !") ; } ;
|
||||
langages.onmouseover = disparition ;
|
||||
langages.onmouseleave = apparition ;
|
||||
langages.onclick = function() { alert("Clic !") ; } ;
|
||||
|
17
1NSI/08_Interaction_web/script/1E_ope_varia.js
Normal file
17
1NSI/08_Interaction_web/script/1E_ope_varia.js
Normal file
@@ -0,0 +1,17 @@
|
||||
>>> let a = 1
|
||||
...
|
||||
>>> (a * 3 + 1) ** 2 / 5 - 1
|
||||
...
|
||||
>>> let b = "Hello"
|
||||
...
|
||||
>>> b + " World"
|
||||
...
|
||||
>>> typeof(a)
|
||||
...
|
||||
>>> typeof(b)
|
||||
...
|
||||
>>> a = b + a;
|
||||
...
|
||||
>>> const c = 1;
|
||||
...
|
||||
>>> c = c + 1;
|
Reference in New Issue
Block a user