0
Canāt change HTML element on Submit
Iāve been trying to create a program that gets a number as an input and outputs an array directly related to that number in the HTML paragraph. Iām not sure how to do this. Every time I run the code the array is undefined and thereās a script error. Here is a simpler version of this code: https://code.sololearn.com/WBJqK1x6cRb3/?ref=app
5 Answers
+ 2
Does this do what you want it to do?
https://code.sololearn.com/W6x8Zc3RMFc4/?ref=app
+ 1
Change "getElementByTagName" to "getElementsByTagName".
Also, what are you wanting to be displayed in the alert box?
+ 1
Yes, thank you! (:
+ 1
No problem š
0
The array should be alerted when itās about to replace āresultā from the paragraph. it always says āundefinedā. I used it to know if my list ever got created... It never gets created