Instantly share code, notes, and snippets.

Embed
What would you like to do?
input type number
<!DOCTYPE html>
<html lang="en">
<head>
<title>input</title>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport"
/>
<style>
label {
display: block;
margin-bottom: 10px;
}
input {
display: block;
height: 40px;
-webkit-appearance: none;
}
</style>
</head>
<body>
<label for="">
<input type="text" name="" placeholder="text: everything else" value="">
</label>
<label for="">
<input type="number" name="" placeholder="number: price,ages,ages" value="">
</label>
<label for="">
<input type="tel" name="" placeholder="phone" value="">
</label>
<label for="">
<input type="text" name="" placeholder="text: pattern[0-9]*" pattern="[0-9]*" value="">
</label>
<label for="">
<input type="text" name="" placeholder="text: pattern[0-9]{2}" pattern="[0-9]{2}" value="">
</label>
<label for="">
<input type="number" pattern="[0-9]*" name="" placeholder="number: [0-9]*" value="">
</label>
<label for="">
<input type="number" pattern="[0-9]{2}" placeholder="number [0-9]{2}" name="" value="">
</label>
<label for="">
<input type="text" name="" value="" placeholder="text: inputmode" inputmode="numeric">
</label>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment