-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
51 lines (43 loc) · 1.53 KB
/
index.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
<html>
<head>
<title>ODU Boards</title>
</head>
<!-- Including ibraries dont mind this-->
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script>
// Wait Until Our Document Loads Before We start running JavaScript on it
$(document).ready(function(){
updateCourseCount();
function updateCourseCount() {
var numberOfCourses;
numberOfCourses = $("#courses").children().length;
$("#courseCount").html(numberOfCourses)
}
// When Someone clicks the button perform some logic
// http://api.jquery.com/submit/
$( "#addCourse" ).submit(function( event ) {
var course = $("#courseToBeAdded").val();
$("#courses").append("<li>"+ course + "</li>");
updateCourseCount();
event.preventDefault();
});
});
</script>
<body>
<div class="container" id="main">
<h1> ODU Boards </h1>
<h4> Number of Classes: <span id="courseCount">3</span></h4>
<ul id="courses">
<li>CS121</lu>
<li>BIO121</lu>
<li>Math212</li>
</ul>
<form class="addCourse" id="addCourse" action="" method="post">
<input type="text" id="courseToBeAdded" name="course" value="" placeholder=Course>
<input type="submit" name="submit" value="Submit">
</form>
</div>
</body>
</html>