开发者

JQuery append event to existing event

Have some code

<a href=# onclick=alert("in onclick")> Click me </a>

I want to append an additional event to onclick, e.g. if the user clicks on the link, he gets 2 messages:

  1. from standard 开发者_StackOverflow社区onclick
  2. from jQuery onclick


<a href='#' id='your_link' onclick='alert("in onclick")'> Click me </a>

In your javascript :

$('#your_link').click(function()
{
  alert('jquery onclick') ;
}) ;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜