diff options
-rw-r--r-- | example/index.html | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/example/index.html b/example/index.html new file mode 100644 index 0000000..d28e0ae --- /dev/null +++ b/example/index.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8" /> + <title>South African ID Parser Test Page</title> + </head> + + <body> + <input id="idNumber" /> + <pre id="result"></pre> + + <script src="../south-african-id-parser.js"></script> + <script> + var input = document.getElementById("idNumber"); + var output = document.getElementById("result"); + + input.addEventListener("input", function(e) { + let result = saIdParser.parse(e.target.value); + output.innerText = JSON.stringify(result, null, 2); + }); + </script> + </body> +</html> |