//ckick()方法鼠标左键单击,但我想要中键单击,有方法吗?
var link = document.createElement( "a ");
link.innerText= text;
link.href = url;
document.body.appendChild(link);
link.click(); //ckick()方法鼠标左键单击,但我想要中键单击,有方法吗?
------解决方案--------------------onmousedow
------解决方案--------------------link.onmouseup =f unction()
{
if(window.event.button == 4)
{
//...这里处理
//alert(window.event.button);
}
}
}