Ahmad Zaib X-Islamian
Ahmad Zaib X-Islamian

Reputation: 81

how to get value from hidden input type array using jquery

How to get value from hidden input type array my input is below and i am trying this code

  <input type="hidden" name="POSITION[]" value="10">
  var arr= $('input[type="hidden"][name="POSITION[]"]').val();

Upvotes: 2

Views: 1494

Answers (1)

Tariq
Tariq

Reputation: 402

Try this code

var arr = $('input[type="hidden"][name="POSITION[]"]').map(function(){
  return this.getAttribute("value");
}).get();

Upvotes: 4

Related Questions