Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello friends ,
if i have to jump to some div on the same page then i uses
Section 7

but here Section_7 is the name of Div now the question is can i access the same div by Id of div ? if yes then how ? please give me answer
Posted
Updated 9-May-20 5:36am

In exactly the same way - if your div has an id of (for example) "section7", then:
HTML
<a href="#section7">Section 7</a>

Will scroll the page so that the start of the div will be at the top of the page (assuming the page is long enough).
 
Share this answer
 
Comments
Prasad gavande 16-Jul-13 2:38am    
Thank you Graham
As for some years you don't need anchors.
You can simply use any id on a page as anchor.
HTML
<div id="id152">blabla</div>
...
..
<a href="http://yoursite.com/yourpage.html#id152"></a>
 
Share this answer
 
Comments
Prasad gavande 16-Jul-13 2:38am    
Thank you Zoltan

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900