Xeptor Xeptor - 1 year ago 80
jQuery Question

Hide element with Javascript based in IP-Adress

Im trying to hide an element based on an IP-adress.

With this script I can write out the IP-adress in the DOM:

<script type="text/javascript" src="https://l2.io/ip.js?var=userip"></script>
<script type="text/javascript">document.write("Your IP is :", userip)</script>

How Do I target this to remove the element below based on a specific IP-address?

Answer Source

just use document ready and check the ip. IF it matches the condition do your stuff

    var ip=['123.123.123','111.111.11']
     $(document).ready(function () {
{ your  code here
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download