javascriptjquery

call to function jquery/ javascript


if I have a button that has onclick event like that:

'<a href="" class="ui-btn" onclick="call('+item.id+')">Aprobar</a>' 

How I have to define this function call?

$ function call(id){

)}

Thank you


Solution

  • you just need keep your function simple like this .

    function call(id){
    alert(id);
    
    }
    

    It will work for you !!