html,js点击按钮跳转链接并打开新的标签页

window.open指令

demo(){
	window.open('https://xxx.com');//直接添加链接可以跳转
}

也可以添加变量

demo(url){
	window.open(`http://${url}`);//使用反引号``+${}添加变量
	window.open('http://' + url);//直接拼接
}

你可能感兴趣的:(javascript,html,前端)