this is probably very easy but I can't figure it out :)
$('#myDiv').html('<a onclick="remove_item(variantId);">Remove</a>');
variantId is a JS variable so I need to pass it's value in the code above.
$('#myDiv').html('<a onclick="remove_item(' + variantId + ');">Remove</a>');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With