怎么让JS 里的图片链接成为在新窗口打开

2024-11-18 16:35:58
推荐回答(2个)
回答1:

$('mainphofo').onclick = function() {location = this.getAttribute('name');}
改成
$('mainphofo').onclick = function() {window.open(this.getAttribute('name'));}