-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathform_sabmition.html
48 lines (47 loc) · 1.99 KB
/
form_sabmition.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<style>
.hidden{
display: none;
}
</style>
</head>
<body>
<section class="container">
<div class="hidden alert alert-success alert-dismissible fade show" role="alert" aria-live="assertive">
<strong>Success!</strong> Success submit form.
<button type="button" class="close" data-dismiss="alert" aria-label="Close alert message">
<span aria-hidden="true">×</span>
</button>
</div>
<form>
<div class="form-group">
<label for="exampleInputEmail1" aria-label="Email Label">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail1" title="email input" aria-describedby="emailHelp" placeholder="Enter email">
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
</div>
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" id="exampleCheck1">
<label class="form-check-label" for="exampleCheck1">Check me out</label>
</div>
<button type="button" onclick="toggleClass()" class="btn btn-primary" aria-live="polite">Submit</button>
</form>
</section>
<script>
function toggleClass() {
let form = document.querySelector('form');
let alert = document.querySelector('div[role="alert"]');
form.classList.add('hidden');
alert.classList.remove('hidden');
}
</script>
</body>
</html>