Using map:
var values = $("input[id='task']")
.map(function(){return $(this).val();}).get();
If you change or remove the id (which should be unique), you may also use the selector $("input[name="task\\[\\]"]")
Working example: http://jsbin.com/ixeze3
More Related Contents:
- Sorting array of object based on range of Numbers of String [closed]
- How to find the sum of an array of numbers
- JQuery .each() backwards
- Why does typeof array with objects return “object” and not “array”? [duplicate]
- Finding matches between multiple JavaScript Arrays
- How to add an object to an array
- Parsing JSON objects for HTML table
- Check if an array is empty or exists
- Find and remove objects in an array based on a key value in JavaScript
- How to count the number of occurrences of each item in an array? [duplicate]
- Using jQuery to compare two arrays of Javascript objects
- Get unique results from JSON array using jQuery
- Compare 2 arrays which returns difference
- How to Compare two Arrays are Equal using Javascript? [duplicate]
- What is the most efficient way to sort an Html Select’s Options by value, while preserving the currently selected item?
- Javascript algorithm to find elements in array that are not in another array
- Filter strings in Array based on content (filter search value)
- What does $(selector)[0] mean in jQuery?
- jQuery min/max property from array of elements
- remove item from array using its name / value
- Get largest value in multi-dimensional array javascript or coffeescript
- Remove occurrences of duplicate words in a string
- Can I append an array to ‘formdata’ in javascript?
- How to set DOM element as first child?
- Create array of all integers between two numbers, inclusive, in Javascript/jQuery
- Convert js Array() to JSon object for use with JQuery .ajax
- Sorting an Array of JavaScript Objects a Specific Order (using existing function)
- How to flatten array in jQuery?
- javaScript: Can a comma occur after the last set of values in an array?
- How to put all elements’ content in array using jQuery ?