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

240
Vistas
How to change the dropdown button's caret symbol when clicked ? HTML CSS Javascript

enter image description here

Suppose I have a dropdown button that looks like the picture above.

When I click on this drop down, it looks like this,

enter image description here

Notice, how the caret symbol "v" is still inverted.

I want that caret symbol to be "^" instead.

Here is the code I have so far.

<div class="dropdown">
   <button id="num-of-results-btn" data-target="#myDropdown" class="dropbtn">30 results</button>
   <div id="myDropdown" class="dropdown-content">
       <a href="">10 results</a>
       <a href="">20 results</a>
       <a href="">30 results</a>
   </div>
</div>

I have copied this snippet of code from the link

"https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_js_dropdown"

From the link above, there is no caret symbol at all.

But when I copy that code into my project, suddenly the caret symbol appears.

So, how can I located that caret symbol and manipulate it the way I described above ?

I would appreciate any pointers or tips that can throw me in the right direction.

Here is the CSS that I am applying to this code.

.dropbtn{
    height: 48px;
    width: 200px;
    padding: 0;
    margin: 0;
    text-align: start;
    padding-left: 1rem;
    background: white;
    border: 1px solid #D6D6D6;
    border-radius: 4px;
    font-weight: bold;
    font-size: 16px;
    line-height: 24px;
}

.dropbtn:hover, .dropbtn:focus {
    background-color: lightskyblue;
}

.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    width: 198px;
    overflow: auto;
    border: 1px solid #D6D6D6;
    border-radius: 4px;
    font-weight: bold;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
  }

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

Also, my project does include the bootstrap4.

about 4 years ago · Juan Pablo Isaza
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