I'm not sure this answers your question. I have created an inline element that scrolls the page to a specific element without an anchor tag. Please tell me if this is what you are looking for.
You can use the browser function URL to scroll to a text fragment .
chrome and safari support it, but unfortunately firefox or older browser versions don't: https://caniuse.com/url-scroll-to-text-fragment
You just need to add the #:~:text=Search fragment to your URL.
Your web application must not encode the characters #:~:.
But please note: if you are using user input to build URLs, do not disable URL encoding for full URLs. Because encoding is a security feature to prevent XSS.
So I didn't provide the real link in the answer because that link doesn't work here since ~ is encoded by stackoverflow. So just copy and paste the link to see how it works.
I'm not sure this answers your question. I have created an inline element that scrolls the page to a specific element without an anchor tag. Please tell me if this is what you are looking for.
Link
You can use the browser function URL to scroll to a text fragment . chrome and safari support it, but unfortunately firefox or older browser versions don't: https://caniuse.com/url-scroll-to-text-fragment
You just need to add the
#:~:text=Search
fragment to your URL.Example: en.wikipedia.org/wiki/Hyperlink#:~:text=link destination
hint:
#:~:
. But please note: if you are using user input to build URLs, do not disable URL encoding for full URLs. Because encoding is a security feature to prevent XSS.~
is encoded by stackoverflow. So just copy and paste the link to see how it works.