Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8987547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:49:20+00:00 2026-06-15T21:49:20+00:00

Generated output is as follows: HTML <div id=resultCancel class=error style=display: block;> <a class=close>X</a> <ul

  • 0

Generated output is as follows:
HTML

<div id="resultCancel" class="error" style="display: block;">
    <a class="close">X</a>
    <ul style="">
        <li for="ProductId" generated="true" class="error" style="">Please Enter License Key</li>
    </ul>
</div>

I need to empty the contents of the li when you click the a.close (before anyone kills me, we’re using an old code base which is why I’m using the .live funciton)

$('a.close').live('click',function(){
   $(this).parent().fadeOut("fast");
   $(this).closest//.next//.sibling('ul').addClass('foo');
});

by using closest I can go up the DOM tree, I need to go down. .next and .sibling are having no effect…. If it matters the div#resultCancel is triggered by jQuery validation plug in.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:49:22+00:00Added an answer on June 15, 2026 at 9:49 pm

    You can use .next()

    $this.next('ul').find('li.error').addClass('foo').html('Text Changed!!')
    

    Use .on() instead of .live() as the latter is deprecated..

    $('a.close').on('click',function(){
       var $this = $(this);
       //$this.parent().fadeOut("fast");
       $this.next('ul').find('li.error').addClass('foo').html('Text Changed!!')
    });
    

    Also you need not change the text as you are hiding the parent div.

    Check Fiddle

    For Dynamic elements delegate the event

    $('body').on('click','a.close',function(){  // jQuery > 1.7.0
    
    $('body').delegate('a.close' ,'click',function(){  // jQuery < 1.7.0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Some generated output can be as follows: <div class=fivecol></div> <div class=sevencol>content</div> if the div.fivecol
I'm trying to use XSL-stylesheets in order to transform some generated XML-data to HTML-output.
I want to redirect output in such a way that works for output generated
I want to output the query generated by a symfony propel select for testing
Is there a way to inject R code output into the generated document without
This script successfully generated the pdfs to a folder tmp/.... However the ZIP output
I frequently use HTML output in applications, up to now I've used some simple
I am trying to validate via RegEx as follows... If Regex.IsMatch(Output, \b & Serial)
I have a build script fragment that looks as follows: foreach(...) ... add_custom_command( OUTPUT
I'm new to PHPUnit, and I'm having some trouble with unit testing HTML output.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.