I'm trying to figure out how to pass a URL I get from a string, to an iFrame on a different html page. Here is my code so far. It successfully takes the first 10 characters in my <p></p> and appends it to the end of a specific URL(which I cannot share, sorry!) What I am trying to do is open this in an iFrame so I can have a certain back button in it. Here's my code! Thanks in advance.
<script>
    function myFunction() {
        var el = document.getElementById("info"),
            text = el.innerHTML,
            res = text.substring(0, 10);
        el.innerHTML = res;
        var url = "https://www.google.com/#q=" + res;
        window.location = url;
    }
</script>
<button href="#" onclick="myFunction()">check</button>
				
                        
you can try this one: