-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·62 lines (47 loc) · 1.39 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
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="pt-br" xml:lang="pt-br">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jrQuery</title>
<script src="js/jrQuery.js"></script>
</head>
<body>
<div>
<h3>Exemplo de máscaras</h3>
<label for="cpf">CPF (000.000.000-00)</label>
<input type="text" id="cpf">
</div>
<div>
<h3>Exemplo de eventos</h3>
<div>
<label for="keyUpEvent">KeyUP Event</label>
<input type="text" id="keyUpEvent">
<p id="keyUpValue"></p>
</div>
<div>
<label for="clickEvent">Click Event: (<span id="clickValue">OFF</span>) </label>
<button id="clickEvent">ON/OFF</button>
</div>
</div>
</body>
</html>
<script>
// Usando o alias do jrQuery
$.fn.debug = function(){
this.each(function(index, el) {
console.log(el);
});
}
$(document).ready(function() {
// Input MASK
$('#cpf').mask("000.000.000-00");
// Event Examples
$('#keyUpEvent').on('keyup', function() {
$('#keyUpValue').html(this.value);
});
$('#clickEvent').on('click', function() {
var value = $('#clickValue').html() == 'ON' ? 'OFF' : 'ON';
$('#clickValue').html(value);
});
});
</script>