How can I retrieve the current text from a page regardless of whether the URL has been submitted or not? For example, if a user changes the value directly in the URL but doesn't submit it.
I've tried using window.location.href
but that requires submission to get the URL.
Is there another way to achieve this without submitting? Perhaps by utilizing a JavaScript framework with dynamic routes?