Skip to content

Instantly share code, notes, and snippets.

@SomtoUgeh
Created December 10, 2022 14:58
Show Gist options
  • Save SomtoUgeh/3fff45a77abefbeed3c22e253bd37c45 to your computer and use it in GitHub Desktop.
Save SomtoUgeh/3fff45a77abefbeed3c22e253bd37c45 to your computer and use it in GitHub Desktop.
good numeric input - accessible and clean
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Numeric input</title>
</head>
<body>
<main>
<form>
<input type="text" inputmode="numeric" pattern="[0-9]*">
<button type="submit">Submit</button>
</form>
</main>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment