Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
hacer clic automático en tampermonkey javascript

tratando de hacer una secuencia de comandos de eliminación automática de filas sin eliminar algunas líneas específicas con orden de venta # SO10100

 let delete_nums = ["#SO202771", "#SO202772", "#SO202773"]; function getRowsToDelete() { // Initialize an array that's going to contain all the rows to be deleted let delete_rows = []; // Get the element that contains all the rows const ordenDeVenta = document.getElementsByClassName("uir-machine-row"); // Loop through all these rows Array.from(ordenDeVenta).forEach(row => { // Find the cell that contains the order no. const cellWithNum = row.children[x]; // Go through each order no that has to be deleted delete_nums.forEach(num => { // If it's in the cell if (cellWithNum.textContent.contains(num)) { // Add the row to the array delete_rows.push(row); } }) }) // Return the array with rows to be deleted return delete_rows; }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Si desea hacer clic automáticamente en el elemento (como dice su título), puede usar:

 row.click();

Deberías tener un evento en la fila. De lo contrario, si está en un botón, busque el botón en sí.

Si desea eliminar una línea, puede usar element.remove() que hará el trabajo:

 function del(id) { document.getElementById("row-" + id).remove(); }
 <table> <tr> <th>A</th> <th>B</th> <th>C</th> </tr> <tr id="row-1" onclick="del(1)"> <td>1</td> <td>1</td> <td>1</td> </tr> <tr id="row-2" onclick="del(2)"> <td>2</td> <td>2</td> <td>2</td> </tr> </table>

Aquí, todo se simplifica. En su caso, en lugar de usar getElementById , está usando el elemento secundario de getElementsByClassName .

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!