Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

195
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda