0

I have a page where I have to disable a div click through an attribute. What wrong am I doing here?

HTML Code
    <div title="You cannot edit when value is in Closed status" clickdisabled="disable">
                        <a href="/122/edit">edit</a>
                    </div>



Jquery Code
    $([clickdisabled = "disable"]).attr("disabled", "disabled").off('click');
1
  • I don't understand the you need. Can you be more specific? Commented Sep 24, 2014 at 23:13

2 Answers 2

2

You can try something like this:

$( "div[clickdisabled='disable'] a" ).click(function(e){
e.preventDefault();
return false;
});

Thanks

Sign up to request clarification or add additional context in comments.

Comments

1

You just be able to do this as well.

  $( "div[clickdisabled='disable'] a" ).off("click");

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.