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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:37:50+00:00 2026-06-02T20:37:50+00:00

I need a click event for jQuery so that when someone clicks on an

  • 0

I need a click event for jQuery so that when someone clicks on an image on my site, it will run the click event and then send them to the destination link from the “a” tag. How would I do this? I assume the click event would be on the link? Maybe not? Here is the link and image

<a href="go/to/here" class="link_for_image">
   <img alt="Image!" class="dynamic" width="200" height="200" src="image/path/here">
</a>

EDIT

I need to do some Javascript before I send the user to the link. Sorry for the confusion.

  • 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-02T20:37:53+00:00Added an answer on June 2, 2026 at 8:37 pm

    You don’t need to do that. Since tour image is wrapped inside an anchor tag, when you click on image, it will be considered as a click on the anchor tag.

    EDIT : From your comment, you want to do some javascript before the actual link works

    $(function(){
     $(".link_for_image").click(function(e){
       e.preventDefault();
       var item=$(this);
       //Here you can do what you want on the clik
    
       window.location.href=item.attr("href");
     });    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote a jQuery function that currently runs on Click Event. I need to
I need to capture the 'Update' click event with jQuery in an asp.net GridView
I need to use href instead click event so I can use hover in
In a web page button click event we need to export 2,00,000 to 5,00,000
What do I need to do in order to reference the double click event
I have a situation where I need to bind a click event to an
I have a hidden button on a form that I need to click in
I am hoping that someone can help me. I have found this jquery script
I have jQuery that uses the change event from a selection box to update
What's the simplest way to detect a click event with jquery for touchscreens only?

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.