Solved

Looking to target the a tag and remove its functionality

Posted on 2012-04-09
1
173 Views
Last Modified: 2012-04-30
Looking to target the a tag and remove its functionality, either remove the onclick or disable the link.

This is an override to html that I cant edit, so adding a class or id to the text will not work. How can I target the link using the mootools framework without add a class or id to the html.

Thanks for your help.


          <div id="hglink">
              <span id="linklabel"></span>
                <a href="javascript:;" onclick="toggleDiv();this.blur();return false;">
                    <span id="linktext">Enter Address</span>
                    <span id="hgzip"></span>
              </a>
          </div>
0
Comment
Question by:yando18
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 20

Accepted Solution

by:
Proculopsis earned 500 total points
ID: 37823765
Check out this jsfiddle.

jQuery(document).ready(function() {
    $("button").click(function() {

        $("#hglink a").removeAttr("onclick");
        $("#hglink a").removeAttr("href");

    });
});

Open in new window

0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem evaluating javascript equality expression 8 18
TypeError jquery issues with site - CSS conflicts 3 28
Jquery driving me nuts... 14 28
Two decimal 5 29
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question