jquery - Utilizing $('Selector').each to set different variables on each submit -
http://jsfiddle.net/ewill3532/qtyec/11/
i need implementing this:
$('selector').each();
i'm trying script set value of each input unique variable each time submit button clicked. you'll see right now, on each submit, value previous question gets alerted - setting variable unique each question.
any here appreciated!
you push every item array everytime select item, leaving unique reference (index) every value so:
var array = []; $('button').click(function () { var $p = $(this).closest('.ques'); var val = $p.find(':checked').val(); if (val === 'non-profit or group' || val === 'individual') { $('.q3').remove(); } alert(val); array.push(val); $('.ques').hide(); $p.next().fadein(); return false; });
Comments
Post a Comment