I've seen answers dealing with selecting elements in CSS and I'm wondering if it is possible to perform the following with one line using a wildcard in jQuery?
jQuery('.youtube-video-1')[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
jQuery('.youtube-video-2')[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
jQuery('.youtube-video-3')[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
I've tried:
jQuery('.youtube-video-\\S*')[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
jQuery('[class^=youtube-video-]')[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');