<img id="corridor" src="Images/Corridor.jpg" class="centre" usemap="#map1">
            <img id = "key" src="Images/key.png" onclick="pickupKey()">
    
    <map name="map1">
        <area onclick="tryDoor()" id="door1" onblur="door1.focus()" autofocus shape="rect" coords="830,240,750,350"/>
    </map>
    function tryDoor(){
        if (hasKey == true) {
        alert("you open the door");
        }else{
        alert("The door is locked find a key");
how can i make it so that when hasKey == true and the door is opened the user will be taken to a different webpage. I have been unsuccessful in trying to use hyperlinks to solve this issue.
Thanks.
 
    