Target only the span of current row jQuery -


how target span of current row?did research closest might work can't under stand usage table.

   var spanid = $(this).closest('tr').next().find('span').attr("[name='wpc_subtotal']");     spanid.text(sum); 

here fiddle.

just remove next code () refer next tr has value of 0 because don't change refer other element target.

 var spanid = $(this).closest('tr').find('span').attr("[name='wpc_subtotal']"); 

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 -