Q:

Link from a html to directly a block element on other website

Please help me, I have a html that contain a link
<a href="LoginandRegistration/Login_register.html#signup">Sign Up</a>

When I was click it I want to move it right into other html 
<div class="containerlogin">
        <div class="avatarcontainer avatar">
            <img src="avatar.jpg">
        </div>
        <div class="Loginbox">
            <div class="form">
                <form class="login-form" name="login">
                    <p>User Name</p>
                    <input type="text" placeholder="Enter Your Name"/><br>
                    <p>Password</p>
                    <input type="text" placeholder="Enter Your Password"/><br>
                    <input type="submit" value="Login"><br>
                    <p class="message">Create an account? <a href="#">Register</a></p>
                </form>
                <form class="register-form" name="signup">
                    <p>User Name</p>
                    <input type="text" placeholder="Enter Your Name"/><br>
                    <p>Password</p>
                    <input type="text" placeholder="Enter Your Password"/><br>
                    <p>Email</p>
                    <input type="email" placeholder="Enter Your Email"/><br>
                    <p>Phone number</p>
                    <input type="tel" placeholder="Enter Yo Telephone Number"/><br>
                    <p>Address</p>
                    <input type="text" placeholder="Enter Your Address"/><br>
                    <button>Create Account</button>
                    <p class="message">Alreday Have an account? <a href="#">Login</a></p>
                </form>
            </div>
        </div>
    </div>

Javascript
<script src='https://code.jquery.com/jquery-3.3.1.js'></script>
    <script>
        $('.message a').click(function(){
         $('form').animate({height:"toggle",opacity: "toggle"},"slow");
        } )
    </script>

Here is the form 
https://i.imgur.com/vg27sQo.jpg 
https://i.imgur.com/ogEdgSY.jpg
I use the javascript to change to login form to the sign up form but when I put a link like LoginandRegistration/Login_register.html#signup to the link on first html that can't link directly to sign up form, it still link to login form 
Please help me, thanks. 

A:

The url hash is a link to an id related anchor in the page - You need to add the id to the form - such as:
<form class="register-form" name="signup" id="signup">

That said - I would do it differently - I would display  only the form identified by the url hash - rather than showing both and scrolling to the indicated one.

