Click here to Skip to main content
14,573,479 members
Rate this:
Please Sign up or sign in to 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
Rate this:
Please Sign up or sign in to vote.

Solution 1

In exactly the same way - if your div has an id of (for example) "section7", then:
<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).
   
Comments
Prasad gavande 16-Jul-13 2:38am
   
Thank you Graham
Rate this:
Please Sign up or sign in to vote.

Solution 2

As for some years you don't need anchors.
You can simply use any id on a page as anchor.
<div id="id152">blabla</div>
...
..
<a href="http://yoursite.com/yourpage.html#id152"></a>
   
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100