Is it possible to make an <a href>
link to the same page when your destination doesn't have an ID?
<a href = "#">Jump to Topic 1</a>
...
<!--destination is below-->
<h1 class="tab-title" data-editor-style="title" style="color:#444444">Topic 1</h1>
Is it possible to make an <a href>
link to the same page when your destination doesn't have an ID?
<a href = "#">Jump to Topic 1</a>
...
<!--destination is below-->
<h1 class="tab-title" data-editor-style="title" style="color:#444444">Topic 1</h1>
A URL fragment identifier can only target an element with a matching ID, or a corresponding named anchor. You cannot link to arbitrary elements without IDs. (There was a proposal that would have allowed the use of CSS selectors as fragment identifiers, in which I was personally involved, but it never took off.)
The best you can do is to use JavaScript to select the element you want and give it an ID that is reserved for your hyperlink. If the elements matching this selector will change then you will additionally have to listen for such changes and handle them accordingly, but that's probably beyond the scope of this question.
Sadly, the answer is no. You need an ID or at least a name, like CBroe mentioned in a comment of your question.
However, I found this here: