dimanche 23 avril 2017

Error implementing a counter with HTML and JS

I am a beginner trying to create a web slide in which the value of a p element with id points has a decrease in value each time a link which calls the JS function is clicked. But nothing happens. Could you tell me where I went wrong? Sorry for any inconvenience

  <!DOCTYPE html>
<html>
<head>
<script>
  plus = 40;
  var function changepoints(){
  plus = plus - 4;
  minus = count/2;
  document.getElementById("points").innerHTML = "Points:" + plus +" or " + minus; 
}
</script>
</head>
<body>
<p><a href="#" onclick="changepoints()">Change points</a></p>

<p id="points">Points: +40 or -20</p>

</body>
</html>




Aucun commentaire:

Enregistrer un commentaire