Feat(NSI): ajoute le deuxième exercice

This commit is contained in:
2023-03-04 16:00:10 +01:00
parent 0e00d80273
commit 376be97f01
9 changed files with 93 additions and 20 deletions

View File

@@ -0,0 +1,3 @@
for (let i = 5; i<10; i++){
console.log("allez " + i);
}

View 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")
}

View File

@@ -0,0 +1,5 @@
function vousAlerte(texte) {
alert("Je vous alerte!")
alert(texte)
}
vousAlerte("Regarde derrière toi!")

View File

@@ -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>

View File

@@ -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"

View File

@@ -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 !") ; } ;

View 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;