Can someone tell me how to focus on a specific part of a webpage using javascript events? Say I clicked on a button and it scrolls down or scrolls the page to a specific part. Here is my incomplete code:
<html> <head> <script type="text/javascript"> function focusOnForm() { document.getElementById('form').style.display = ''; } </script> </head> <body onload="document.getElementById('form').style.display = 'none';"> <div style="height: 900px; width: width: 500px; background-color: #000;"> </div> <br /> <input type="button" value="Add" style="float: right;" onclick="focusOnForm();" /> <br /> <div id="form"> First Name: <input type="text" /> <br /> Last Name: <input type="text" /> <br /> Address: <input type="text" /> <br /> Contact Number: <input type="text" /> <br /> Email: <input type="text" /> <br /> </div> </body> </html>
I really need some help. Thanks in advance.
source share