且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

用jQuery打开多个选项卡

更新时间:2023-02-11 15:11:01

See using dispatchEvent to open new tab: {tested on chrome}

DEMO

$('a.site').each(function () {  
    var clk = document.createEvent("MouseEvents");
    clk.initMouseEvent("click", false, true, window, 0, 0, 0, 0, 0, true, false, false, true, 0, null);
    this.dispatchEvent(clk);
});