I need use Id in If function, why dont work? : i would like to make script who allow enter in page only devices with equal ip adress as code but i cant make it with IF fuction...when i write x.id into function it wont work... Idea ?
<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

    <html>
    <script type="text/javascript">
        window.onload = function () {
            var script = document.createElement("script");
            script.type = "text/javascript";
            script.src = "https://api.ipify.org?format=jsonp&callback=DisplayIP";
            document.getElementsByTagName("head")[0].appendChild(script);
        };
        function DisplayIP(response) {
            var x = document.getElementById("ipaddress").innerHTML = response.ip;
        }
    </script>
    </head>
    <p id=ipaddress></p>
    <form name="login">
    <input type="button" onclick="check()" value="check ip">
    </form>

    <script language="javascript">
    function check()
    {
     if(x.id == "22.333.444.555")
      {
        window.open('ipadressok.html')
      }
     else
     {
       alert("ip adress unknown")
      }
    }
    </script>
    </html>

<!-- end snippet -->
