Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

156
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda