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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -