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

289
Views
Materialize CSS - multiple select with disabled selected issue

Even on official MaterializeCSS page for Select when you select a value for multiple select you see the disabled selected "Choose your Option" and then the selected option(s).

enter image description here

It seems to me more user friendly to shoe only Option 1 as "Choose your option" is not a valid option.

I use the

      <option value="" disabled selected>Choose your option</option>

so once page is rendered the user got a hint what is required of them.

Working jsFiddle.

It seems to me that using jQuery solves this issue (see an example) but I am using pure javascript only.

So the question is How to not display disabled, selected text for multiple MaterializeCSS select.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Copied from your js fiddle , this will fix your unselect issue.

function  onSelectChange(s){
  const elOptions = s.querySelectorAll('option')
  elOptions[0].removeAttribute('selected') // this won't work
  elOptions[0].selected  = false; ///this will - tested //first option will be unselected
}
about 4 years ago · Juan Pablo Isaza Report
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!