I'm trying to apply attr allow="autoplay;
to my iframe shown in this image.
I've tried
jQuery(".esg-entry-media-wrapper iframe").attr("allow", "autoplay;");
But it's not working.
EDIT : Works with the code below.
jQuery("document").ready(function() {
setTimeout(function() {
jQuery(".esg-vimeo-frame").attr('allow', 'autoplay');
},1000);
});
your iframe doesn't have .esg-entry-media-wrapper
class
what you should do is give right class.
jQuery(".esg-vimeo-frame").attr("allow", "autoplay;");
Edit:
DOM
is ready and then assign that attribute to an element