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 7526971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:59:02+00:00 2026-05-30T03:59:02+00:00

Using jQueryUI. When users click on the delete_comment_button image, I want a dialog to

  • 0

Using jQueryUI. When users click on the delete_comment_button image, I want a dialog to appear that allows users to delete their comment.

The challenge: the image falls within a span (all the other dialogs on my site work fine). How do I specify an image within a span in the selector?

Code below; jsfiddle here: http://jsfiddle.net/GRVBz/1/

HTML

<span class="delete_comment_button"><img src="delete-button.png"></span>

<div id="delete_comment_dialog" title="Alert">
Are you sure you want to delete this comment?
</div>​

​jQuery

  $(function(){

    $( "#delete_comment_dialog" ).dialog({
            autoOpen: false,
            modal: true,
            buttons: {
                Cancel: function() { $( this ).dialog( "close" ); }
            }
    });
  });


    $('.delete_comment_button img span').click(function() { 
            $('#delete_comment_dialog').dialog('open'); 
            return false; 
    });

​

  • 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-05-30T03:59:04+00:00Added an answer on May 30, 2026 at 3:59 am

    You just have your selector around the wrong way. The img is within the span, so use:

    $('span.delete_comment_button img').click(function() { 
            $('#delete_comment_dialog').dialog('open'); 
            return false; 
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm actually using JQueryUI Dialog plugin to show some information to the users of
I am trying to create popup using the jqueryui dialog. I am trying to
To give more information I am using the modular form here: http://jqueryui.com/demos/dialog/#modal-form `b(e.target).zIndex` is
I am using the JQUeryUI to present a Dialog Box to the end user
I am using jQuery to create a dialog that should show up in the
I am showing delete confirmation box using jQuery UI dialog. But on delete I
I'm using jQuery and jQuery UI. I experienced that users sometimes fire the ajax-calls
I am using the newest jqueryui and have a link on my homepage that
I'm using JqueryUI for drag and drop on one of my pages and for
I am developing an application using jQueryUI. I am also using the Themeroller. I

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.