+ 3
how to take input from html and use it in js??
i have used the input tag and used it successfully outside of sololearn, but here in sololearn it is not working. I attached my code. hope you have suggestions? https://code.sololearn.com/W5zxbUE6DW5d/?ref=app
4 Answers
+ 3
var text = document.getElementById("in").value;
var rev_text = reverseString(text);
these lines should be inside the event listener.
+ 2
You need to add onsubmit attribute to the button and link it to a function.
As I don't understand jquery I didn't fix it but I hope my answer guides u.
If you need an example let me know and I will show u :)
+ 2
Minerals2016 I tried to put form and on submit but it didn't work here due to sololearn playground limitations.
+ 2
nidhi it worked, thank you so much