This code shows you that how you can check the user's given value is Valid IP Address or not using javascript on button click event.