href to link to another spot on a page and redirect the page to that spot

<div id="MENUID" class="MENUID-btn" onmouseleave="close()">

<ul>
<li><a href="HOME">HOME</a></li>
<li><a href="ABOUT US">ABOUT US</a></li>
<li><a href="CONTACT_US">CONTACT</a></li>
<li><a href="#developer">DEVELOPER</a></li>
</ul>
</div>



</div>

</div>
<div class="newarrival">
<div class="Box1"></div>
<div class="Box2"></div>
<div class="Box3"></div>
</div>


<div id="#developer" class="container2of3">
<div class="WEBDEV"><span><img src="/img/2of3/WEB\ VS\ PNG.png" alt=""></span></div>
<div class="DEVPHOTO"></div>
<div class="BIO">lorem</div>
</div>

</div>
<div id="MENUID" class="MENUID-btn" onmouseleave="close()">

<ul>
<li><a href="HOME">HOME</a></li>
<li><a href="ABOUT US">ABOUT US</a></li>
<li><a href="CONTACT_US">CONTACT</a></li>
<li><a href="#developer">DEVELOPER</a></li>
</ul>
</div>



</div>

</div>
<div class="newarrival">
<div class="Box1"></div>
<div class="Box2"></div>
<div class="Box3"></div>
</div>


<div id="#developer" class="container2of3">
<div class="WEBDEV"><span><img src="/img/2of3/WEB\ VS\ PNG.png" alt=""></span></div>
<div class="DEVPHOTO"></div>
<div class="BIO">lorem</div>
</div>

</div>
I am trying to redirct the user to another spot on the page, when they click on the <a>, can I do that this way
6 Replies
MarkBoots
MarkBoots10mo ago
yes, these are called named anchors or bookmark links The href starts with # and has the id of the element you want to go to With this method you can also navigate to a specific place on another page for example: <a href="contact.html#form">Contact form</a>
chrono1913
chrono1913OP10mo ago
but can i use it to another spot on the same page
MarkBoots
MarkBoots10mo ago
yea, that's what i said
chrono1913
chrono1913OP10mo ago
sry its just not working im trying to get the navi to go to #developer when the user clicks developer in the <a>
MarkBoots
MarkBoots10mo ago
make a codepen please a wait, developer div id is starting with a #, that is not necessary. only on the link (sorry, did not spot that on first sight) so it should be:
<a href="#developer">DEVELOPER</a>
<div id="developer"></div>
<a href="#developer">DEVELOPER</a>
<div id="developer"></div>
chrono1913
chrono1913OP10mo ago
o it was a spelling error ops thanks
Want results from more Discord servers?
Add your server