Board Thread:Code Review/@comment-29457887-20160327083649

I'm making a script which opens up a modal window when a YouTube link is clicked: $('a[href*="www.youtube.com"]').on('click', function{   var id = $(this).attr('href').substring(str.indexOf("&") + 1);    $('body').prepend('  ✕   ');    $('.close-modal').on('click', function { $(".greyout, .mymodal").remove; });   return false; }); Despite adding, it still opens the YouTube site. How to fix it? 