简体   繁体   English

从输入框创建JavaScript数组。 文字和整数

[英]Creating an JavaScript array from Input boxes. Text and integers

I will have some sort of form on the page and will need to save the values into an array to run through an algorithm. 我将在页面上使用某种形式,并将需要将值保存到数组中以通过算法运行。 Any ideas how i could do this. 任何想法,我怎么能做到这一点。 Had a quick google search to no avail. 快速谷歌搜索无济于事。

怎么样...

var arr = $( '.inputs' ).map( function () { return $( this ).val(); }).get();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM