1
I am trying to create a script to replace everything inside a div with something predefined, I am new in javascript and I am working to find a solution for this, I searched in several places, but I did not get anything.
I’m calling the script using url.searchParams.get
if(url.searchParams.get("sub") == 1) {
document.getElementById("rep").innerHTML = "<p>Outro texto</p>"
}
<div id="rep">Texto</div>
Vc created the URL object?
– Sam
What would be
url.searchParams.get
?– Costamilam