Programmatically scroll to an Anchor Tag

前端 未结 8 1578
孤独总比滥情好
孤独总比滥情好 2020-11-28 07:21

Consider the following code:

GoTo Label2
... [content here] ...
More content


        
8条回答
  •  难免孤独
    2020-11-28 07:36

    If the element is an anchor tag, you should be able to do:

    document.getElementsByName('label2')[0].focus();
    

提交回复
热议问题