I have this function:
$(document).ready(function() {
$('.UIDropDown').click(function () {
$('.button', this).click(function(e){ e.preventDefault()});
$(this).addClass('active');
});
});
And the following html:
<div class="UIDropDown">
<a href="" class="button">button link</a>
<ul class="submenu">
<li><a href="">Item</a></li>
<li><a href="">Item</a></li>
<li><a href="">Item</a></li>
</ul>
</div>
Why is the e.preventDefault() not working on the .button? The page still refreshes .
Thx,