Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

151
Vistas
making autoclick on tampermonkey javascript

trying to make an auto delete rows script without deleting some specific lines with 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 Respuestas
Responde la pregunta

0

If you automatically want to make such as click on the element (as your title said), you can use:

row.click();

You should have an event on the row. Else, if it's on a button, search the button itself.

If you want to remove a line, you can use element.remove() that will do the job:

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>

Here, everything is simplified. In you case, instead of using getElementById you are using children element of getElementsByClassName.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda