Skip to content

Instantly share code, notes, and snippets.

@andrewjcurrie
Created May 10, 2023 00:21
Show Gist options
  • Save andrewjcurrie/5fd8e1f68d46e9f3cf39d74bb60dbece to your computer and use it in GitHub Desktop.
Save andrewjcurrie/5fd8e1f68d46e9f3cf39d74bb60dbece to your computer and use it in GitHub Desktop.
IPv4 Address Validator
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JavaScript IPv4 Address Validator</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body onload='document.ipform.ipaddr.focus()'>
<div class="container">
<h2>Enter an IP address then click 'Validate'</h2>
<form name="ipform" action="#">
<ul>
<li><input type='text' name='ipaddr'/></li>
<li>&nbsp;</li>
<li class="submit">
<button onclick="ValidateIPaddress(document.ipform.ipaddr)">VALIDATE</button>
</li>
<li>&nbsp;</li>
</ul>
</form>
</div>
<script type="text/javascript" src="validator.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment