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

181
Vistas
How to generate UIUD using button without refreshing the whole page

enter image description here

here is my javascript on how im generating the UIUD and Regenerate Secret are my HMTL. I know to not refresh the whole page I need a type='button' in the button element, but when i add that, i am not loading up anything using my onClick. I really don't understand why adding type= button would break this. Thanks for the help!

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

This is too weak as an answer since your problem isn't clear yet. Anyway it's a step to show that the problem lies elsewhere. As you can see that's how a button should behave (while being of type button).

But you should include your javascript as text, instead of picture, if you want it to be included here.

function onClick(event){
  const uuid = generateUUID();
  document.getElementById('status')
    .textContent = `a new UUID:${uuid} was generated!`;
}

function generateUUID(){
  return '12345' + Math.floor(Math.random() * 9999);
}
button{
  cursor: pointer;
  margin-bottom: 1rem;
}

#status{
  border: dashed 2px gray;
  padding: 1rem;
}
<button type="button" onclick="onClick(event);">Generate UUID</button>

<div id="status"></div>

about 4 years ago · Santiago Gelvez Denunciar
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