Can iframe add parameters to URL?

What I want is to add a parameter to the URL of the parent document from a script inside the iframe that is in the webpage.
I made this code:

document.querySelector("#id").addEventListener("click", () => {

    window.history.replaceState(null, null, "?qwe=sub")

});