Bonjour,

le code suivant vous fera comprendre ce que je cherche à faire - Ce qui ne va pas, c'est qu'au lancement du script les réponses s'affichent au lieu d'être cachées - Par ailleurs, je voudrais (et je ne sais pas comment faire) ajouter à cette question d'autres questions 2, 3, 4, 5 ....

Merci

Code html : Sélectionner tout - Visualiser dans une fenêtre à part
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
<!DOCTYPE html>
<html lang="fr">
<head>
	<meta charset="utf-8" />
	<title>Toggle_show_hide</title>
	<style>
#myDIV {
    width: 100%;
    padding: 50px 0;
    text-align: center;
    background-color: lightblue;
    margin-top:20px;
}
</style>
</head>
<body>
<a><h2>Exercice 10</h2>
<p></p>
<a>Traduisez</a> 
<p></p>
<p>I. Le maire a laissé les promoteurs acheter le parc du château.</p>
 
<button onclick="myFunction()">Réponse</button>
 
<div id="myDIV">
The mayor let the property developpers buy the parc of the manor house.
</div>
 
<script>
function myFunction() {
    var x = document.getElementById('myDIV');
    if (x.style.display === 'none') {
        x.style.display = 'block';
    } else {
        x.style.display = 'none';
    }
}
</script>
 
</body>
</html>