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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:57:57+00:00 2026-06-01T04:57:57+00:00

I have one link in a div id where i have to disable the

  • 0

I have one link in a div id where i have to disable the click event and also hidden.
here is my Div id which i need to disable click event.

<div  class="bookmark" align="left">
  <div align="left">&nbsp;&nbsp;
    <img src="<c:url value="/images/Bookmarks1.png">"align="absmiddle" border="0" width="18" height="18" /> 
<a href="#" id="bookmarkviewall" class="book tabs" style="text-decoration: none;"> Bookmark</a> &nbsp;
    <a href="#"  id="bookmarkpopup" class="book tabs"  onclick="javascript:return false;">
      <img alt="Add Bookmark" src="<c:url value="/images/red_plus.png"/>" align="absmiddle">
    </a>
  </div>
</div>

the Function i wrote is :-

function disablingBookmark(){
  $("#bookmarkviewall").removeAttr("href");
  $("a#bookmarkviewall").removeAttr("class");
  $("#bookmarkpopup").removeAttr("href");
  $("a#bookmarkpopup").removeAttr("onclick");
  $("a#bookmarkviewall").attr("class","greyFont tabs1");
  $("#colorpickerDiv").hide();
}

this is My js file:-

$("#bookmarkviewall").click(function(e){
         var selectedId = "#"+currentSelectedTabId;
         $(selectedId).removeAttr("style");
         currentSelectedTabId = null;
         highlight($('#content').attr("id"));
    //For hiding the popuped menu
    //$("#rightHandPanelStatus").attr("recent","bookmarks");


        highlightForToolBox($('#bookmarkviewall').attr("id"));  

        var currentNumberOfRecordsPerPage = 10;
        var currentPageNumber = 1;

        $.post("/core-web/bookmark/viewlist", jQuery.param({pageNumber :currentPageNumber, NumberOfRecordsPerPage :currentNumberOfRecordsPerPage, pageId:currentPageId}), function(data) {
                $('#center_in').html(data);
        });



    });
},

the link is disable but still the click event is working.any help. please
thanks.

  • 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-01T04:57:59+00:00Added an answer on June 1, 2026 at 4:57 am

    You can remove href attribute first and use e.preventDefault() to prevent your default click function. See example code below and demo here

    var link = $(".bookmark").find("a");
    link.removeAttr('href');
    link.click(function(e) {
        e.preventDefault();
    });​
    

    I have used different image on your actual code. See on Jsfiddle

    Its working here. Seems like something wrong on your jsp code. Please check your code and make sure its working.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one link which opens a div and it works fine, but I
Possible Duplicate: click link below a higher z-index div I have two divs, one
I have a table which needs to link one of three seperate tables, but
I have noted that when i click one link on the facebook the content
I have a main div which contains two divs. One for main content and
I have one more question(first one is here: html, css with center div problem
I have vertical submenu as under: <div id=dropdown_menu class=menu> <ul> <li> <a>First Link</a></li> <li>
my issue lokks similar to this one: (link) but i have one-to-many association: <set
i have one domain link text i want to know that does google crawl
You must have noticed one link in yahoo.com, msn.com or other popular websites named

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.