events jQuery
Estimated reading time: 1 minuteclick
$(function() {
$("#demo").click(function() {
$("body").html(Date());
alert("ok");
});
});
onclick
<p onclick="myFunction(this, 'red')">Click me to change my text color.</p>
<script>
function myFunction(elmnt,clr) {
elmnt.style.color = clr;
}
</script>
$('body').on('click', '.editProduct', function () {
var product_id = $(this).data('id');
//
}
<a data-id="123">link</a>
$(this).data("id")