Bonjour, je voulais automatiser la cloche d'une école et pour cela j'ai écris ce code:
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<html>
<head>
<title>Auto School Bell</title>
<script type="text/javascript">
 
function updateClock ( )
{
  //GET CURRENT DATE-TIME
  var currentTime = new Date ( );
 
  //GET THE CURRENT TIME
  var currentHours = currentTime.getHours ( );
  var currentMinutes = currentTime.getMinutes ( );
  var currentSeconds = currentTime.getSeconds ( );
 
 
  //CREATE STRING OF TIME
  var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds;
 
  //DISPLAY TIME IN DIV
  document.getElementById("clock").firstChild.nodeValue = currentTimeString;
  
  
 
var NextRing = "11:1:0";
  
  
  //Autoring
  if(currentTimeString == NextRing) document.getElementById("myAudio").autoplay;
  
  //NextRing
  document.getElementById("NextRing").firstChild.nodeValue = NextRing;
  
 
}
 
 
 
</script>
</head>
 
<!-- REFRESHES CLOCK EVERY SECOND-->
<body onLoad="updateClock(); setInterval('updateClock()', 1000 )">
 
<!-- DSIPLAYS CLOCK IN HERE -->
<h3 id="clock">&nbsp;</h3>
<p>
<audio id="myAudio" controls>
  <source src="School_Bell.wav" type="audio/wav">
  <source src="School_Bell.mp3" type="audio/mpeg">
  Your browser does not support the audio element.
</audio>
<p>
 
<h3>NEXT RING</h3>
<p id="NextRing">NEXT RING</p>
</body>
</html>


mais ça marche toujours pas!

Je pense que le problème est ici:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
if(currentTimeString == NextRing) document.getElementById("myAudio").autoplay;
Aidez moi svp!