0

I want to remove the default arrow appearing in the list input field. is there anyone please who can help me and show me a way to add a new arrow in place of the default arrow here?

<body>
   <form >
      <label for="data-list">Choose a browser from this list 
         <input list="browsers" name="my-browser" placeholder="Enter color">

         <datalist id="browsers">
            <option value="Green"></option>
            <option value="Red"></option>
            <option value="Blue"></option>
            <option value="Yellow"></option>
            <option value="Black"></option>
         </datalist>
      </label>
      
   </form>
</body>

here is the default arrow i am talking about

my expectation is to remove the default arrow and replace with a new arrow icon in the list input field

0

1 Answer 1

0

We have to add type="text" to the input, and define the following:

input[type="text"]::-webkit-calendar-picker-indicator {
    display: none !important;
}
<body>
  <form>
    <label for="data-list">Choose a browser from this list 
         <input list="browsers" name="my-browser" placeholder="Enter color" type="text">

         <datalist id="browsers">
            <option value="Green"></option>
            <option value="Red"></option>
            <option value="Blue"></option>
            <option value="Yellow"></option>
            <option value="Black"></option>
         </datalist>
      </label>

  </form>
</body>

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.