I have a set of links:
<div id="dd" class="mywrap-dropdown-2" tabindex="2">Select
<ul class="dropdowner" id="coll-filter">
<li><a href="#">Black</a></li>
<li><a href="#">White</li>
<li><a href="#">Blue</li>
</ul>
</div>
If clicked the link “White” then my links “Black” and “Blue” would no longer be clickable.
This is what I have but does not work:
$( '.dropdowner' ).on( 'click', 'li', function( e ) {
e.preventDefault();
$(".dropdowner li a").not(this).removeAttr("href")
});
unbind()to unbind all the click events associated with that classTry this .. This will remove the click event for other links when the link with Black is clicked..
CHECK FIDDLE