How to check validation of IP Address in jquery

前端 未结 9 1770
挽巷
挽巷 2021-01-17 21:39

I need to add IP Validation in my project .Is there any function in jquery or in jquery mobile.So that it will validate the in put field?

Thanks

9条回答
  •  逝去的感伤
    2021-01-17 22:02

    You can use regular expressions to test if an IP is valid:

    "127.0.0.1".match(/^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$/);
    

提交回复
热议问题