A simple named anchor does not work in FF, but it works in IE

I have a a hreflink:

/agenda/#Testevent

Which in IE goes to the corresponding element <h4>, but in Firefox it does not work.

I used this anchor anchor:

<h4 name="#Testevent" id="#Testevent">

Any suggestions?

+3
source share
2 answers

You can do it:

<h4><a name="Testevent">Title</a></h4>

Or you can also do this:

<h4 id="Testevent">Title</h4>

"Target anchors in HTML documents can be specified either by an A element (by naming it with a name attribute) or by any other element (by naming with an id attribute)."

Source: w3.org: links in HTML documents

+6
source

Drop the '#'

name = "Testevent"

+7

Source: https://habr.com/ru/post/1734409/


All Articles