So I want to get HTML elements from multiple pages using JavaScript.
However, as soon as I redirect the user to another page using location.href = "https://www.example.com"
, the developer console reloads.
Is there a way to prevent this?
EDIT
While sojin's answer shows a way to preserve the text being output, I can't find a way to keep the code, that was input to run after the redirect, running.