Question: What's wrong with the following code? Title function average () { document.getElementById(numberA).value b = document.getElementById(numberB).value alert((a + b) / 2); a = Find average You

 What's wrong with the following code? Title function average () {

What's wrong with the following code?

Title

You should replace both occurrences of .value with .innerHTML None of the other choices are correct. O The first line of the function should be function average(a, b) { You should be using prompt instead of getting values from text fields. You're not adding numbers. Instead, you're pasting strings one after another. The body tag is missing an onload attribute. You need an if statement in order to compute the average

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!