Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

194
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda