jQuery | Pass url parameters to an iframe

// Iframe Container
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
jQuery(function() {
    var oldIframe = jQuery('#iframe');
    if (oldIframe.length) {
        var src = oldIframe.attr('src');
        if (src) {
            var iframeContent = $('<iframe id="iframe-new" src="' + src + location.search + '" style="border: none;width: 100%;background-color:#fff;"></iframe>');
            oldIframe.replaceWith(iframeContent);
        }
    }
});
</script>
<iframe id="iframe" src="https://go.domain.com/form.html"></iframe>
My website may contain fan art inspired by existing characters from movies or tv shows, I dont own any rights. Any copyright owner willing to remove those fan arts can contact me here. This is a personal portfolio, the sole use of cookies are for analysing my traffic through Google Analytics, if you're ok with that please accept this terms by closing this disclaimer.