-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDemo.html
99 lines (87 loc) · 2.54 KB
/
Demo.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<html>
<head>
<script src="Demo.js"></script>
<style>
.validationMessage {
color: red;
font-style: italic;
}
#myTable {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 600px;
}
#myTable td,
#myTable th {
border: 1px solid #ddd;
padding: 8px;
}
#myTable tr:nth-child(even) {
background-color: #f2f2f2;
}
#myTable tr:hover {
background-color: #ddd;
}
#myTable th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #4CAF50;
color: white;
}
</style>
</head>
<body>
<!-- Validation -->
<h1>Validation</h1>
<form name="myform1">
<span id="nameValidationMessage" class="validationMessage"></span><br />
Name: <input type="text" name="name" onfocusout="validateName()" /><br /><br />
<span id="emailValidationMessage" class="validationMessage"></span><br />
Email: <input type="text" name="email" onfocusout="validateEmail()" /><br /><br />
<span id="phoneValidationMessage" class="validationMessage"></span><br />
Phone: <input type="text" name="phone" onfocusout="validatePhone()" /><br />
</form>
<!-- Table Filter -->
<h1>Table Filter</h1>
Search: <input id="myInput" onkeyup="searchTable()" type="text" /><br /><br />
<table id="myTable">
<tr class="header">
<th style="width:60%;">Name</th>
<th style="width:40%;">Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Germany</td>
</tr>
<tr>
<td>Berglunds snabbkop</td>
<td>Sweden</td>
</tr>
<tr>
<td>Island Trading</td>
<td>UK</td>
</tr>
<tr>
<td>Koniglich Essen</td>
<td>Germany</td>
</tr>
<tr>
<td>Laughing Bacchus Winecellars</td>
<td>Canada</td>
</tr>
<tr>
<td>Magazzini Alimentari Riuniti</td>
<td>Italy</td>
</tr>
<tr>
<td>North/South</td>
<td>UK</td>
</tr>
<tr>
<td>Paris specialites</td>
<td>France</td>
</tr>
</table>
</body>
</html>