<ul id="footernav">
<li><a href="javascript:void(0);" id="chat" data-icon="custom" data-transition="none">Tools</a></li>
<li><a href="javascript:void(0);" id="email" data-icon="custom" data-transition="none">My Ride</a></li>
<li><a href="javascript:void(0);" id="login" data-icon="custom" data-transition="none">News</a></li>
<li><a href="javascript:void(0);" id="skull" data-icon="custom" data-transition="none">Cool</a></li>
<li><a href="javascript:void(0);" id="coffee" data-icon="custom" data-transition="none" class"ui-btn-active ui-state-persist">Contact</a></li>
</ul>
现在我正在使用这个 jQuery 函数来获取我点击id
的那个:li
$('#footernav li').click(function(){
alert($(this).attr('id'));
});
但它返回undefined
。