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

222
Vistas
How to change the color of the Youtube Like button?

Problem

I am trying to change the color of Youtubes Like-button from the default color to blue:

https://i.imgur.com/xmsDFZK.png

I easily managed to do it with the browser developer tools:

https://i.imgur.com/P6snS2p.png


via Console

However, now I am trying to do it programmatically, for example via the console. But I am not sure what exactly to put in there to correctly identify the Like-button.

I tried the following but it did not work, it had no effect at all:

document.querySelector('.style-scope .ytd-toggle-button-renderer')
    .querySelector(".style-scope .yt-icon")
    .getElementsByTagName("path")[0]
    .style.color = "blue"

What is the correct way to identify the Like-button and to change its color?


Details

The Like-button appears to be coded like this:

<yt-icon-button id="button" class="style-scope ytd-toggle-button-renderer style-text" touch-feedback="">
    <button id="button" class="style-scope yt-icon-button" aria-label="Ich mag das Video (wie 11.598.005 andere auch)" aria-pressed="false">
        <yt-icon class="style-scope ytd-toggle-button-renderer">
            <svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" style="pointer-events: none; display: block; width: 100%; height: 100%;" class="style-scope yt-icon">
                <g class="style-scope yt-icon">
                    <path ...>...</path>
                </g>
            </svg>
        </yt-icon>
    </button>
    <yt-interaction id="interaction" class="circular style-scope yt-icon-button">
        <div class="stroke style-scope yt-interaction">
        </div>
        <div class="fill style-scope yt-interaction">
        </div>
    </yt-interaction>
</yt-icon-button>

Where the actual button I want to change is this line here

<yt-icon class="style-scope ytd-toggle-button-renderer">

I am using the latest Firefox (91.0.2), Desktop version.

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

0

Youtube may possibly change the layout based on various factors. On Firefox this seems to work:

document.querySelectorAll('#menu-container #top-level-buttons-computed #button > yt-icon > svg > g > path')[0].style.color="blue";
about 4 years ago · Juan Pablo Isaza Denunciar

0

Try like this

document.querySelector('.style-scope > .yt-icon > path")[0]
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