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

145
Vistas
How can I "click" all div in the firefox console?

How can I perform a "click" action on all the rows that start with "label style-scope ytcp-button" in the following html:

<div class="label style-scope ytcp-button">Edit Draft</div>

Here what i tried

$("div[class^=label style-scope ytcp-button]")​​​​​​​​​​​​​​.click();

it seem not work.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

You can use the simple JS method querySelectorAll().

const els = document.querySelectorAll('.label.style-scope.ytcp-button');

els.forEach((el) => {
  el.click();
  console.log('clicked');
});

about 4 years ago · Juan Pablo Isaza Denunciar

0

You have missed the Apostrophe. You should write like this:-

         $("div[class^='label style-scope ytcp-button']").click();

Run the code snippet below, it will not run alert method on clicking on the last div as the "ytcp-button" class is missing in the last div.

$(document).ready(function(){
    $("div[class^='label style-scope ytcp-button']").click(function(){
        alert("You have Click a Specific Class");
    });
});
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="label style-scope ytcp-button">It will Show Alert</div>
    <div class="label style-scope ytcp-button">It will Show Alert</div>
    <div class="label style-scope ytcp-button">It will Show Alert</div>
    <div class="label style-scope">It will not Show Alert</div>

    <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
    <script src="script.js"></script>
</body>
</html>

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