<!DOCTYPE html>
<html>
<head>
</head>
<div id="wrapper">
<button>GO</button>
</div>
<body>
<script>
wrapper=document.querySelector("#wrapper")
go=function(){setTimeout(function(){open("http://javascript.ru")}, 1000)}
wrapper.onclick=function(){this.innerHTML="<span>Thanks</span>", go()}
</script>
</body>
</html>