forked from EscuelaIt/jquery-para-css
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathej2-eventos.html
35 lines (32 loc) · 980 Bytes
/
ej2-eventos.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test jquery</title>
</head>
<body>
<h1 class="main">Eventos</h1>
<p class="main">Esto es un párrafo main</p>
<p><input type="text" id="campoinput"></p>
<button id="miboton">Clic!</button>
<button id="noocultes">Quita el evento que oculta</button>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script>
$(document).ready(function() {
$('#miboton').on('click', function() {
$('.main').css('text-decoration', 'underline')
});
$('#campoinput').on('keyup', function(){
$('#campoinput').val($('#campoinput').val().toUpperCase());
});
function ocultaH1() {
$('h1').text('me voy a ocultar...').hide(5000);
}
$('#miboton').on('click', ocultaH1);
$('#noocultes').on('click', function() {
$('#miboton').off('click', ocultaH1);
})
});
</script>
</body>
</html>