What is my mistake? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
2nd Jun 2017, 6:03 AM
Aditya Raj
Aditya Raj - avatar
3 Answers
+ 6
@Artemis:- I think u didn't understand a question again.🤔...He wants to show the code that's why he wrote the JS code in <body> tag About the problem in your code is :- You didn't add "=" after id It should be like :- <input type ="number" id= "answer"></input>
2nd Jun 2017, 6:23 AM
Nikhil
Nikhil - avatar
+ 6
@Nikhil I DID UNDERSTAND IT!!!
2nd Jun 2017, 6:25 AM
Art456
Art456 - avatar
+ 5
<div id ="code"> var a =Math.sqrt(36);<br /> console.log(a);</div> you can't add JavaScript code in <div> tag you should use <script> tag
2nd Jun 2017, 6:08 AM
Art456
Art456 - avatar