Solved

Looking to target the a tag and remove its functionality

Posted on 2012-04-09
1
175 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
Find out what you should include to make the best professional email signature for your organization.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

729 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