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

140
Visualizações
Adding an action in a text input which deletes the text which the user has written

I am trying to create an "x" that appears at the end of a text input box which can be clicked to delete the text that the user has typed. I have seen this done with Angular, but I can't figure it out with HTML and CSS. I have been using the remove tag and attempting to access the value as such:

<button onclick="myFunction()"> X </button>
<p id="test"> </p> 
<script>
   let theText= input.value;
   function myFunction() {
       return input.value.remove();
   }
</script>

Thank you.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

may be you can try to replace value with null string

input.value = ""
about 4 years ago · Juan Pablo Isaza Relatório
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