Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3
For seccond your syntax for case is wrong, you sometimes add equal, sometimes forgot column It is case "JavaScript": also dom is not loaded, so i wrap everything in window.onload, so when dom is loaded we can select element to set text https://code.sololearn.com/WV7sLQVtK5ZT/?ref=app
4th Dec 2021, 11:55 AM
PanicS
PanicS - avatar
+ 2
You need to wrap your onclick value with quotes onclick='alert("You have purchased bitcoin")' Also in this case use one quote for onclick and diferent for alert value, it wont work if quotes are same
4th Dec 2021, 11:52 AM
PanicS
PanicS - avatar
+ 2
Ah, PanicS , the name of ":" is colon, not column. I got confused trying to understand what you meant... But yes, confusing colons and semicolons is one of the problems.
5th Dec 2021, 1:10 AM
Emerson Prado
Emerson Prado - avatar
+ 2
Shubham Bhatia Not necessarily. File extensions are just an indication to the user or developer. The operating system, the web server and the browser accept whatever valid name. But yes, the *recommended* filename extension for JS is ".js". Lowercase, please - it's always better to be consistent in style with the rest of the world. The situations where extensions make a difference are: in your IDE or text editor, which can set up a good visual approach for the file type indicated; in Windows, which likes doing stuff backwards...
6th Dec 2021, 2:21 AM
Emerson Prado
Emerson Prado - avatar
+ 1
Javascript file extension is : . Js
6th Dec 2021, 1:37 AM
Shubham Bhatia
Shubham Bhatia - avatar
0
PyNon thats why i post code so you can compare, maybe i forgot to mention something, there was few problems in code, there was something with adition } at end, what i was deleted
4th Dec 2021, 12:53 PM
PanicS
PanicS - avatar
0
PyNon you didnt remove equal from case case "C": not case = "C" and few more, check each case carefuly, some have equal some dont have column at end
4th Dec 2021, 1:15 PM
PanicS
PanicS - avatar
0
Now add column at end ":" and it will work To compare best copy my code and place your in comment, so you can see exacly in one file what you missing.
4th Dec 2021, 1:20 PM
PanicS
PanicS - avatar
0
JavaScript,Kotlin,C dont have : your every text in case end with : not ;
4th Dec 2021, 1:41 PM
PanicS
PanicS - avatar
- 1
How to learn coading i am jew here
6th Dec 2021, 6:01 AM
30 Aaftab Saudagar