Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

235
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!