Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
19
rated 0 times [  24] [ 5]  / answers: 1 / hits: 15297  / 13 Years ago, fri, november 18, 2011, 12:00:00

I want to navigate to an HTML element having a particular 'id' in the same page using javascript on click of a button.



for example:



<body>
<div id=navigateHere >
</div>

<button onclicK=navigate(); />




In the above code what should be there in the javascript function navigate() , so that on a click of a button , it will navigate to the 'div' element with an id 'navigateHere'.....



Thanks in advance ...


More From » html

 Answers
37
 window.location = #navigateHere;

[#89050] Wednesday, November 16, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
magaly

Total Points: 524
Total Questions: 96
Total Answers: 89

Location: India
Member since Wed, Aug 26, 2020
4 Years ago
;