jQuery addClass example

Change class name on click in jQuery

HTML

<div class="indiContent">
https://www.youtube.com/watch?v=VseFBNigUqw&t=3s
</div>

JavaScript

var linked = 'https://www.youtube.com/watch?v=VseFBNigUqw&t=3s';


$(".indiContent").html(function(e, t) {
                        return t.replace(/http(?:s?):\/\/(?:www\.)?youtu(?:be\.com\/watch\?v=|\.be\/)([\w\-\_]*)(&(amp;)?‌​[\w\?‌​=]*)?/g, '<iframe width="100%" height="200" src="https://www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe>').replace(/&[^]*/,'')
                    });