JavaScript Treehouse Club: JavaScript Car Sounds Changing Keywords

edward holmes
edward holmes
2,130 Points

what to put in bikeBell tag

whats the answer to this question?

index.html
<!DOCTYPE html>
<html lang="en">

  <head>
  <meta name="charset" value="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=0.5, maximum-scale=0.5, minimal-ui">
    <title>Car Sounds</title>

    <!--Style Sheet link-->
    <link rel="stylesheet" type="text/css" href="css/style.css">
  </head>

  <body>

    <!--Car image -->
    <img src="images/bike.png" class="car" alt="car">


    <!--Button-->
    <a href="javascript:startCar();"><img src="images/bikeLock.png" alt="key"></a>


    <!--Audio Files-->
    <audio id="startCar" src="sounds/bikeBell.mp3" preload="auto"></audio>


    <!--Javascript-->
    <script type="text/javascript">
        function startCar() {
            document.getElementById('startCar').play();
        }

    </script>

  </body>

</html>

1 Answer

Steven Parker
Steven Parker
149,228 Points

It looks like you did part of task 2, but task 1 isn't done yet.

The first task says, "Start by changing the JavaScript function name from startCar to bikeBell."

So on line 29, you'll change the name of the function.

Then be sure to do both parts of task 2 when you're on that step.