简体   繁体   English

jQuery将click事件传递给onclick属性

[英]jquery pass the click event to onclick property

i have the following tag: 我有以下标签:

<a href="#" class="btn btn-xs userView" onclick="viewUser('+id+')">Se mere</a>

Now i want to pass the click event just like you would do with jquery: 现在,我想传递click事件,就像使用jquery一样:

     $('.checkbox_input').click(function(e)
 {
 })

So that i can have the following function 这样我可以有以下功能

    function viewUser(id,event)
{
         event.stopImmediatePropagation();

}

So pass in event 所以通过event

onclick="viewUser('+id+', event)"

Check out JSBIN DEMO 查看JSBIN DEMO

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM