append table row to other table base on condition

146
March 25, 2018, at 07:28 AM

I have 2 table and i want to append all the table rows to other table which meet certain criteria in Jquery. For example. Table 1

Product-Code   Quantity
  1                0
  2                0
  3                4

I want to append rows to table 2 where quantity is not 0 or empty.

Answer 1
const trsToAdd = [...table1.querySelectorAll('tr')]
  .filter(tr => tr.children[1].textContent !== '0');
trsToAdd.forEach(trToAdd => table2.children[0].appendChild(trToAdd));
READ ALSO
Simple Electron ThreeJS/Bootstrap/JQuery App not woking

Simple Electron ThreeJS/Bootstrap/JQuery App not woking

I am new to Electron and I am trying to build a simple app that includes THREEJS, Bootstrap, and Jquery

161
jQuery load('/path/to/php') loads different css

jQuery load('/path/to/php') loads different css

I have a form written in a php fileThe looks of the form are different when I load the form by visiting the php page, and by calling jQuery

118
Passing URL parameter to another URL

Passing URL parameter to another URL

I'm trying to pass a URL parameterI have parser the URL using the following jQuery code:

161
make a call ajax before another call ajax ends

make a call ajax before another call ajax ends

I have an ajax call that is responsible for uploading (via SFTP)They are large files so I can not lock the page

188