简体   繁体   中英

HTML/Javascript anchor to another section not working

Apologies if this has been answered but I cannot find something specific to my issue. I am trying to do a simple 'scroll down' link to a different section of the page like so:

<a href="#apply-profile">scroll down</a>

This would then link to a form at the bottom of the page defined as:

<form class="recipe" method="post" id="apply-profile”>

This works just fine on Chrome. This however does not work on Firefox for example. I am not sure what the issue is. I am open to a Javascript solution if need be, thanks.

Try changing id="apply-profile” to id="apply-profile" (notice the closing quotation marks).

Works fine for me in Chrome and Firefox.

try putting empty link into your form like this:

<a id="apply-profile"></a>

haven't tested that, but I saw some people do it like this

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM