Javascript to make the page jump to a specific location

后端 未结 8 556
悲哀的现实
悲哀的现实 2020-12-13 15:09

I there a way in javascript to make the page jump to a specific location on the page, such as


         


        
8条回答
  •  忘掉有多难
    2020-12-13 15:41

    This can be accomplished by first creating an anchor for the page landing spot using HTML.

    somewhere
    

    Once you have the landing site, simply use the JavaScript:

    window.location = 'yoursite.html#jumpHere';
    

提交回复
热议问题