Solved

Looking to target the a tag and remove its functionality

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

932 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now