How can I store bunch of jQuery code lines in a variable to use it later on the document..? -
i have , have use in several palaces in jquery code. can't use function, because '.payment-items input' appended after document loaded. want way reduce code lines , increase performance , use example variable instead of lots of these bunch of code lines.
$('.payment-items input').each(function(index){ var value = $('.payment-items input').eq(index).val(); var price = $('.payment-items input').eq(index).parent().find('p span').html(); final += (value * price); });
Comments
Post a Comment