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

134
Views
anterior().remove(); no se aplica al hermano anterior

Creé elementos li y después de cada elemento li hay un div de clase crossSign que contiene dos rectángulos que forman una cruz. Quiero que, cuando se haga clic, elimine a su hermano anterior y elimine la cruz. Pero no funciona cuando se hace clic. ¿Alguien puede decirme cuál es el problema? Y no puedo dar el html o el css porque tengo miedo de que alguien lo copie.

 $newform.on('submit', function(e) { e.preventDefault(); var text = $newform.find('input:text').val(); var url = document.getElementById('addurl').value; $list.append('<a href="'+ url +'"><li class="links"><span>' + text +'</span></li></a>'); $list.append('<div class="crossSign"><div class="line1"></div><div class="line2"></div></div>'); //$('a').attr('href', url); $newform.find('input:text').val(''); $addurl.val(''); }); $('#close-form').on('click', function() { $newform.hide(); $newlinks.show(); }); $('.crossSign').on('click', function() { $(this).prev().remove(); $(this).remove(); });
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!