-
Notifications
You must be signed in to change notification settings - Fork 0
/
2.html
38 lines (31 loc) · 924 Bytes
/
2.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
<!-- 2 Attach a function to the blur event. The blur event occurs when the following <input> Field1 loses focus. Go to the editor
Sample Data :
<body>
<form>
<input id="field1" type="text" value="Field 1">
<input id="field1" type="text" value="Field 2">
</form>
</body> -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<form>
<input id="field1" type="text" value="Field 1">
<input id="field1" type="text" value="Field 2">
</form>
</body>
<script>
$(document).ready(function () {
$("input").blur(function () {
alert("Lose focus from Field");
});
});
</script>
</html>