标签: javascript javascript-events event-handling href
可能重复: JavaScript function in href vs. onclick
从<a>开始,可以通过两种方式调用Javascript:
<a>
<a href="javascript:alert('href triggered me')">Click me!!!</a>
<a href="#" onclick="alert('I was triggered by a DOM event')">Click me!!!</a>
据我所见,网络开发人员平等对待这两种方式。两者的优点和缺点是什么?