How can I make a HTML a href hyperlink open a new window?

前端 未结 1 325
耶瑟儿~
耶瑟儿~ 2020-12-08 04:03

This is my code:

test

        
相关标签:
1条回答
  • 2020-12-08 04:22
    <a href="#" onClick="window.open('http://www.yahoo.com', '_blank')">test</a>
    

    Easy as that.

    Or without JS

    <a href="http://yahoo.com" target="_blank">test</a>
    
    0 讨论(0)
提交回复
热议问题