Uhm, There is something wrote in my JavaScript. I did not learn much on JavaScript. | Sololearn: Learn to code for FREE!

+1

Uhm, There is something wrote in my JavaScript. I did not learn much on JavaScript.

alert('To the Given imformation of Apple & Android Users Answer the following Questions.'); var username = prompt("Apple id & Account"); confirm (username); else if { var username = alert("Uhm, There was a typo..") }

8/11/2022 9:40:16 AM

Lost Campain

9 Answers

New Answer

+6

Because you are taking user input and what ? Confirming ? See below it is some changes Specifically I didn't actually understand how you used else if Means do you wanted to match the username input with other pre defined username equal or not? 👇🏻 alert('To the Given information of Apple & Android Users Answer the following Questions.'); var username = prompt('Apple id & Account'); var word = confirm(username); if(word == true) { alert("Welcome " + username); } else { alert("Uhm, There was a typo.."); }

+7

isaiah Armstrong but Your code is just confirming yes or no (means either ok or cancel) and no user input But Lost Campain even wanted to take id value from the user So you can use prompt() for that

+6

Do you wanted to create pre defined username value and wanted to check whether it's equal or not with the user input ??? there is typo in "information"

+6

Lost Campain its my pleasure to help you 🙂🙂🙂

+2

i think ot should be like this: alert("to answer given questions ...") var username = confirm("apple id & account") if(username === true){ alert("correct") }else if(username === false){ alert("err") }

+1

Okay, thank you very much Suparna!

+1

Have a great day Suparna

+1

May i ask suparna? What if user skipped the test, is it possible to change?

+1

isaiah Armstrong it's easier on Suparna and more valued + easier to understand, but thank you still!