Why my javascript code not working?

Guidance:

Answer the about three questions and also press choose.

Ones score can appear.

Insight values:

JUST ONE.A byte is the number of bits

TWO.Steve Work heads what exactly company

3.Bill Entrance heads just what company

Productivity value:

Effect #1:

Effect #2:

Effect #3:

Ones score:

It’s tough choosing how to start.

1st, you need to end a person’s expressions by using semicolons.I are aware that they obtain entered automatically however the automatic job sometimes may it wrong and it also ends in place breaking ones script around ways not no problem finding.So adhere to JavaScript greatest practices and always end an expression using a semicolon.

This kind of:

var firstName;
firstName = “John”;

Possibly not this:

var firstName
firstName = “John”

You can also save you some keying by expressing your variable and controls its value together.

var Reverse = SOMETHING LIKE 20;
var firstName = insurance policy.getElementById(“first-name”);

Upcoming, you state your variables along at the top of your respective function.Would you great training but later inside your code an individual add three more issues that were unable defined along with var.Would you see these people Here’s the particular list.

myResult1
myResult2
myResult3
score

JavaScript can be case vulnerable so Report and report are a pair of different objects in terms of JavaScript is anxious.

Your script is actually missing a closing curly brace when they get home of your own function.

With your if blocks you need to do:

in the event that (myAnswer2.toLowerCase() == “Apple”.toLowerCase())…

You possibly can simplify it to the present:

in the event that (myAnswer2.toLowerCase() === “apple”)…

You possibly can just write the idea of apple around lower case as opposed to calling the function to perform it.Also develop === operator when comparing values.

You never develop Result1, Result2, and Result3 variables when you finally set them to support HTML aspects.

Likewise, Bill Gates seriously isn’t the mind of Yahoo and google but I am just pretty sure you realize that and they are just utilizing it to acquire a wrong answer message.I still must mention the item in in case I’m incorrect.

Leave a Reply