I am creating links to sections on the same page in HTML. By default they are not visible display : none. I want when my user clicks on the link (URL) which included id so it should set display : block
. For example opening is the id when window.location.href includes #opening
so content should be visible. User can simply hit mydomain#opening in the browser without clicking <a>
or #id
.
HTML
<p id="opening">Hyperlinks are utilized by a web browser to move from one page to another...</p>
<p>My Name is XYZ...</p>
CSS
#opening {display : none;}