I'm trying to figure out how to convert below code to Javascript. Is there a conversion tool online for simple conversions?
$('head script[async][src*="analytics"]').on('load', function() {
ga('send', 'event', 'checkout', 'complete');
});