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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:58:50+00:00 2026-06-05T12:58:50+00:00

I have a image associated with the anchor tag, once the user clicks the

  • 0

I have a image associated with the anchor tag, once the user clicks the image a popup loads. I want to disable this anchor tag.

The html code looks like:

<a href="#" class="openModalLink">
<img style="vertical-align: middle; border: none" width="9%" alt="" id="imgmap" class="zoom" /></a>

I have tried the below codes but doesn’t seem to work

 $(".openModalLink").off("click");
 $(".openModalLink").attr("disabled", true);
 $(".openModalLink").attr("disabled", "disabled");

Thanks for the replies

  • 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-05T12:58:51+00:00Added an answer on June 5, 2026 at 12:58 pm

    You could do this

    $('.openModalLink').click(function(event){
        event.preventDefault();
    });
    

    Also refer docs

    EDIT:

    To enable and disable anchor tag

    function disabler(event) {
        event.preventDefault();
        return false;
    }
    
    $('#enable').click(function(){
        $('.openModalLink').unbind('click',disabler);
    });
    $('#disable').click(function(){
        $('.openModalLink').bind('click',disabler);
    });
    ​
    

    DEMO

    EDIT 2:

    As of jquery 1.7 .on() and .off() are preferred over bind and unbind to attach and remove event handlers on elements

    $('#enable').click(function() {
        $('body').off('click', '.openModalLink', disabler);
    });
    $('#disable').click(function() {
        $('body').on('click', '.openModalLink', disabler);
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have Image like this (source: de-viz.ru ) I want to get something
I have created a content type with an associated image field. Each user is
I have a set of jpeg images where each image has an associated description.
I have image map that can I move, but this map will be so
I have Image which belongsTo User, and I have Coupon which belongsTo User. Each
Approximate program behavior: I have a map image with data associated with the map
I use the following code to reload an image using jQuery: //Fetch image associated
I have an image with an associated image map (below) and I'm using jQuery
I have created an image slider. This slider appears on every page of my
I have an ul with a li that cannot find a .PNG image associated

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.