Friday, 5 December 2014

How can i get value from three input text box at time in jquery

How can i get value from three input text box at time in jquery


i want this three value at a time or in array form.How can i get?? here is html-

<input style='display:none' value='http://localhost/JSG/upload/Hydrangeas6.jpg'  class='imgstr' name='imgstr[]'type='text>
    <input style='display:none' value='http://localhost/JSG/upload/Jellyfish4.jpg'  class='imgstr' name='imgstr[]'type='text'>
    <input style='display:none' value='http://localhost/JSG/upload/Koala1.jpg'  class='imgstr' name='imgstr[]'type='text'>

You can use .map()

var images = $('.imgstr').map(function () {
    return this.value;
}).get();
Enjoy Coding :)

No comments:

Post a Comment