HTML button opening link in new tab

前端 未结 8 1247
挽巷
挽巷 2020-12-05 17:32

So this is the simple code for the button to open a certain link

                
8条回答
  •  有刺的猬
    2020-12-05 17:58

    You can use the following.

    window.open(
      'https://google.com',
      '_blank' // <- This is what makes it open in a new window.
    );
    

    in HTML

     
    

    plunkr

提交回复
热议问题