Skip to content

Instantly share code, notes, and snippets.

@gregoire-bessagnet
Created March 13, 2017 16:58
Show Gist options
  • Save gregoire-bessagnet/274bb0090861b8b16b051e5de4cca3ea to your computer and use it in GitHub Desktop.
Save gregoire-bessagnet/274bb0090861b8b16b051e5de4cca3ea to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MDR JS</title>
</head>
<body>
<p> Hahah ! Petit test de script JS ! <br>
<strong>Réponds au prompt si t'es cho patate !</strong></p>
<script>
var reponse = prompt("Hey mon ami ! Tu aimes ça les patates ?", "<Entrez ici oui ou non>");
if (reponse == "oui"){
var patates = ["#", "#", "#", "#", "#", "#", "#" ];
var tas = [];
for (i = 0; i < patates.length; i++) {
tas.push(patates[i]);
console.log(tas.join(""));
}
}
else if (reponse == "non"){
alert('haha')
}
else alert('Je vous sens comme tiraillé')
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment