Why is the result not displaying | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
12th Mar 2019, 3:38 AM
idris
idris - avatar
1 Answer
+ 8
There are few bugs you must fix in order to make it work. First, put your entire JS code inside a function which will be called after the HTML window get loaded so that your JS can find all the elements. And when you do so, you must add the event listener on the button in the JS part. Second, you need to use inp.value to retrieve the text value in the input field. Here's the working code: https://code.sololearn.com/Wyr8dH32v0Gj/?ref=app
12th Mar 2019, 3:59 AM
Шащи Ранжан
Шащи Ранжан - avatar