假设我有一个触发一些javascript的标签。例如:什么是触发javascript的链接的最佳做法
HTML:
<a href="#" id="some_id">Trigger action!</a>
<!-- or, with appripriate CSS : -->
<span id="some_other_id">Trigger action!</span>
的jQuery:
$("#some_id").click(function() {
alert("some action")
});
我最好如何做到这一点?
我的问题是当我悬停在链接上时,我应该在浏览器的左下角看到什么?即什么是href值应该是?
如果响应是'无',那么正确的方法是跨度。
的一些方法,例如:http://jsfiddle.net/M3qkU/5/
'' is OK, StackOverflow uses them for instance for the "flag" and "close" buttons bellow your question. –