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
+ 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
+ 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.
+ 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...
+ 1
Javascript file extension is : . Js
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
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
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.
0
JavaScript,Kotlin,C dont have :
your every text in case end with : not ;
- 1
How to learn coading i am jew here