-
Notifications
You must be signed in to change notification settings - Fork 25
/
Exam.html
51 lines (47 loc) · 1.6 KB
/
Exam.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
<!DOCTYPE html>
<html>
<head>
<style>
/* your implementation comes here */
h1 {
background-color: red;
font-weight: bold;
}
</style>
<script type="text/javascript">
/* your implementation comes here */
function authenticate() {
let user = document.getElementById("username").value;
let pass = document.getElementById("password").value;
let x = document.getElementById("auth_result");
if ((user == "CSE30332") && (pass == "paradigms")) {
x.innerText = "Authenticated!"
} else {
x.innerText = "Authentication Error!"
}
}
</script>
</head>
<body>
<h1>Sample question</h1>
<div class="row">
<form>
<label for="username">Username:</label>
<input type="text" name="username" id="username" />
<label for="password">Password:</label>
<input type="password" name="password" id="password" />
<input type="radio" name="gender" value="male" />Male<br />
<input type="radio" name="gender" value="female" />Female<br />
<input type="radio" name="gender" value="other" />Other
<input list="Options" />
<datalist id="Options">
<option value="Option1"></option>
<option value="Option2"></option>
<option value="Option3"></option>
</datalist>
</form>
<button onclick="authenticate()">Authenticate</button>
<span id="auth_result"></span>
</div>
</body>
</html>