-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
51 lines (42 loc) · 1.29 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html>
<head>
<title>input number demo</title>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="jquery.mousewheel.js"></script>
<script src="jquery.inputNumber.js"></script>
<link rel="stylesheet" href="inputNumber.css">
<style>
body {
width: 300px;
margin: 40px auto 0;
}
</style>
</head>
<body>
<script>
$(function() {
$('input.num').inputNumber();
$('input.numNegative').inputNumber({
positive: false //deny positive numbers
});
$('input.numPositive').inputNumber({
negative: false //deny negative numbers
});
});
</script>
<form action="">
<fieldset>
<div><label for="c">Default HTML5 input number</label>
<input type="number" id="c"></div>
<div><label for="base1">Basic Number</label>
<input type="text" id="base1" class="num" value="0"></div>
<div><label for="base2">Negative Number</label>
<input type="text" id="base2" class="numNegative" value="0"></div>
<div><label for="base3">Positive Number</label>
<input type="text" id="base3" class="numPositive" value="0"></div>
</fieldset>
</form>
</body>
</html>