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

193
Views
How would I delete the current selected drop-down row in reactJS?

I have a select row where data gets added when an input is entered.

<Input type="select" name="selectProf" id="selectProf">
        <option>-</option>
        {
           thanks.map((t,i) =>
           <option key={i}>{t}</option> )
        }
</Input>

But when the specific option is selected I would like it to delete the specific row rather than the whole data in select.

My previous code was this:

function handleDelete(){
        localStorage.setItem('profileID', '[]')
}

But this cleared the array and in result deleted everything in the select. I tried this:

    function handleDelete(){
        if (JSON.parse(localStorage.getItem('profileID')) === document.getElementById('selectProf').value){
            //code here
        }
    }

However this method did not work as it is incorrect. How would I go abouts deleting the specific select row?

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!