+ 1
How to get value from input field and then add this value into an array?
Hello everyone I want to push a value taken from input field and then add it to the existing array. Also need to write another function to delete values from an array. I'll really appreciate help! Here's my code: https://jsfiddle.net/dima23/e6ce58h4/ P.S Don't get Georgian text this isn't main thing... P.P.S I also don't know why buttons in jsfiddle aren't working, while on playground and local files they are working well except push button.
2 Respuestas
+ 1
Yeah, you use the right function , document.getElementById('id-element'). So you can also use the similar to get value for tex box.
var some = document.getElementsById('idfield').value;
Why dont works buttons, is a question, try it debug. So copy the whole code (html+javascript) into one .html file and run in your computer uder Google Chrome. And then open the Developer tools . It shows you where are errors.
+ 1
Thanks for the answer, I'll definitely try your recommendation.