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
Do it in all jQuery, refer to below code.
remove onclick call and give id, like below :
'<a href="" id="ui-btn1" class="ui-btn">Aprobar</a>'
Then add onclick event using jQuery :
<script>
$(document).ready(function(){
$("#ui-btn1").click(function(
var buttonId = $(this).attr('id');
alert(buttonId);
));
});
</script>
If you wan to bind click event to button by its class name then use below selector
$("#ui-btn1").click(function(
You can select button using various selectors, please see this.