JS on Ticketing Website
Hi all. Not sure if Im overthinking the question but the Javascript part of my code doesnt seem to interact with the form I have made with HTML. There isnt any reference to the form in the question and I dont recall this module teaching anything about linking the JS to the HTML form. When outputting to the console, I just get "18" which is the 2 prices in the question added together. The module just taught basic maths in variables... here is the question: Tasks: 1. Declare two variables, one called adults, the other one children, and initialize them to some values, for example 42 and 8. 2. Declare another variable called price, which will hold the total price of the tickets. 3. Calculate the price of all tickets by using the following prices: Adults: $12, Children: $6. 4. Output the price value to the console. The Form Code: <section id="buy"> <form> <div class="form-section"> <label for="Adults"><b>Adults:</b></label><br> <input type="number" id="Adults"></input> </div> <div class="form-section>"> <label for="Children"><b>Children:</b></label><br> <input type="number" id="Children"></input> </div> <div class="form-section"> <input type="button" value="Buy"></input><br> </div> </form> </section> The JS Code - (doesnt seem to be storing as variables, just assigning a value) let adults = 12; let children = 6; let price = (adults)+(children); console.log(price); ----------- Console:18 Am I doing something wrong or is the question missing something or should the module have taught something else which seems to be the missing piece? Many thanks