For a site I'm doing, I have a feature where a user can hide or delete his posts. When a user hides or deletes his post, I change the div's background color (to make it look like its dead). However, I'd like to disable all the <a></a>
and <i></i>
that are inside them as well (make them un-clickable so he can no longer use them).
How can i do something like this using jquery?
It's much like what happens when you delete your own post here on stackoverflow.com
, only thing is I need all the <a></a>
and <i></i>
disabled. The <i>s
call a jquery function when clicked. That's why I need them disabled.
<div class="post user" id="EN001">
<a href="/user/john">View other posts by John</a>
<i class="icon-hide hide" data-hash="a4d8e82s8w2d2"></i> Hide your post
<i class="icon-delete delete" data-hash="a4d8e82s8w2d2"></i> Delete your post
</div>
$('.hide,.delete').live('click', function() {
// self. I fail here;
});