I NEED HELP IN JAVA_SCRIPT | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 1

I NEED HELP IN JAVA_SCRIPT

why this code doesn't work? how to fix it? https://code.sololearn.com/WXohxpj5t1td/?ref=app

18th Sep 2017, 2:58 PM
Ferrum
Ferrum - avatar
5 ответов
+ 8
just had to change the order of last line of code you were assigning a value to a variable before creating it https://code.sololearn.com/WK3nTHUy55YY/?ref=app
18th Sep 2017, 5:34 PM
Lord Krishna
Lord Krishna - avatar
+ 9
document.getElementById("x") There is no element with ID "x", probably you meant "add". document.getElementById("add")
18th Sep 2017, 3:24 PM
Maz
Maz - avatar
+ 4
Is it normal that it adds a new line even the input has no value ?
18th Sep 2017, 8:09 PM
Aymen ELARBI
+ 2
no, just look at js code i want to innerHTML div with id="x"
18th Sep 2017, 3:32 PM
Ferrum
Ferrum - avatar
+ 2
Thanks!!!
18th Sep 2017, 5:38 PM
Ferrum
Ferrum - avatar