Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
16
rated 0 times [  18] [ 2]  / answers: 1 / hits: 14177  / 11 Years ago, wed, february 26, 2014, 12:00:00

How can I use javascript to reload page and go to a specific div when a button is clicked?



function reloadAgreement() {
location.reload();
}

<li><a href= onclick=reloadAgreement();>Return to Store Info</a></li>

More From » html

 Answers
5
function gototab(reload)
{
window.location.hash = '#tab2';
window.location.reload(true);
}


Return to Store Info



from here
Reload page with different anchor



edit:



To clarify, the section that says #tab2 is the 'id' attribute of the div you want the page to go to when the link is clicked.


[#47388] Tuesday, February 25, 2014, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
collinarnoldp

Total Points: 10
Total Questions: 122
Total Answers: 109

Location: Spain
Member since Thu, Dec 23, 2021
3 Years ago
;