+ 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.

29th Oct 2016, 9:52 AM
Dima Simonishvili
Dima Simonishvili - avatar
2 Answers
+ 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.
29th Oct 2016, 10:46 AM
Petr Hatina
Petr Hatina - avatar
+ 1
Thanks for the answer, I'll definitely try your recommendation.
30th Oct 2016, 12:22 AM
Dima Simonishvili
Dima Simonishvili - avatar