+ 1
Using HTML forms as input for JavaScript. Not working
I want to create a form text box as an input in a JavaScript program I'm making (as opposed to using prompt for input). I'm trying to get the value (what you type into the box) and assign a object property to it. I also want the function to be able to be used in other programs later, so I'm trying to make it general, with any specific parts being arguments of the function. The issue is somewhere between taking the value and assigning the object. Please help! I isolated the functions in the attached code link. Thank you https://code.sololearn.com/WK5NFXiF8PCH/#js
2 Respuestas
+ 1
In function ‘getFieldValue’ type after(); not after;
0
Tomáš Wróbel,
I tried adding () to after and it will delete the from and put 0 it it's place.
It should wait for you to click the button then take whatever is typed and change o1.a from 0 to whatever you typed. Then, it should delete the form and button and say whatever o1.a is (which is what you typed in the box).
But instead it is deleting the form, and not the button, and replacing it with 0, which is the current value of o1.a. Is the eventListener not working because it is calling after() before you click on the button?