<button id="linkTo">按钮</button>
<script type="text/javascript">
function buttonLinkTo(id,url){
document.getElementById(id).onclick = function(){
open(url);
}
}
buttonLinkTo("linkTo","
http://www.baidu.com");
//buttonLinkTo("按钮元素的ID","链接的地址");
</script>