I have a dynamically created background-image for an embedded YouTube video. Now I want to change a part of the background-image url.
This is my HTML code:
<div class="jet-video__overlay--custom-bg" style="background-image: url(https://i.ytimg.com/vi/B3xqE5F2zHQ/maxresdefault.jpg);">
Now I want to change the "maxresdefault" in the url with "hqdefault" using jquery.
This is what I tried so far:
$('.jet-video__overlay--custom-bg').attr("style").replace('maxresdefault','hqdefault');