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

221
Views
cómo hacer que el botón funcione la próxima vez que se presione el botón

Lo que quiero hacer es que cuando haga clic en el botón Sí, se eliminen todos los elementos, y cuando haga clic en el botón de reinicio, todo vuelva, y tantas veces. Lo que obtengo: Presiono el botón "sí", todo se elimina, luego el botón "reiniciar", todo vuelve, quiero presionar el botón "sí" nuevamente, pero nada más funciona

 const body = document.querySelector('.body'); const message = document.querySelector('.message'); const reset = document.querySelector('.panel__close') const bodyMessage = document.querySelector('.body__message') function removeChilds(childs) { for(const child of childs){ child.parentNode.removeChild(child); } } let childs = []; function create() { // here created elements for programm... childs.push(bodyError, bodyErrorImage, bodyText, bodyButtons, bodyButton1, bodyButton); // the created elements are pushing into the array } create(); yes.addEventListener('click', () => { // here deleting all elements and creating congratulation removeElements(childs); childs = []; // created congratulation const paraLox = document.createElement('p'); paraLox.textContent = 'Congratulation, Jaba is work!'; paraLox.style.fontSize = '3rem'; paraLox.style.textAlign = 'center'; paraLox.style.fontWeight = '1000'; paraLox.style.color = 'red'; body.appendChild(paraLox); // reset.addEventListener('click', () => { // reset button paraLox.parentNode.removeChild(paraLox); create(); }); });
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!