The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

jQuery close current DIV

  • # April 5, 2013 at 10:41 am

    Alright guys I am a newbie to jQuery and cant get this one figure out. I have a alert message that has a (x) button to close the current popup. However the way I have it now it will close all the dialog boxes if there are multiple ones on the page. What I need is a way to only close the parent div of the (x) button.

    Here is the link to the working code:


    # April 5, 2013 at 10:52 am

    I would just use $(this).parent() for this:

    # April 5, 2013 at 10:55 am

    That is exactly what I needed, thanks!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed