This is my code:
这是我的代码:
$(document).ready(function(){
var valid_url = new RegExp('https://[www\.]?youtube.com/watch\?v=[a-zA-Z0-9_-]*', '');
$('a').each(function(){
// Check if it's a valid Youtube URL
var link = $(this).attr('href');
if( valid_url.test( link ) ){
alert( "valid" );
}
});
});
$(document).ready(