Jquery wrap iframe in div

How can I get jquery to wrap an iframe in a div, for example using vimeo embed iframe, when loading, jquery wraps it in a div class:

<div class="iframe"><iframe src="http://player.vimeo.com/video/23358638?title=0&amp;byline=0&amp;portrait=0" width="500" height="300" frameborder="0"></iframe></div> 
+6
source share
1 answer

Use the jQuery wrap() function:

 $("iframe").wrap("<div class='iframe'/>"); 
+14
source

Source: https://habr.com/ru/post/887697/


All Articles