Source code

Revision control

Copy as Markdown

Other Tools

<!doctype html>
<script>
function openWindow(id) {
window.childWindow = window.open(location.href + "?" + id, "", "");
}
</script>
<button id="open-click" onclick="openWindow('open-click')">Open window</button>
<button id="focus" onclick="window.childWindow.focus()">Focus window</button>
<button id="open-mousedown">Open window</button>
<script>
document.getElementById("open-mousedown").addEventListener("mousedown", function(e) {
openWindow(this.id);
e.preventDefault();
});
</script>