-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPage1.html
43 lines (19 loc) · 1.1 KB
/
Page1.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
<html>
<head>
<title>
Page1 Title
</title>
</head>
<body>
<input id="NameID"/>
<button id="SaveID">Save</button>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"> </script> <!--this is the jquery function which adds a range of methods-->
<script>
$("#SaveID").click(function(){ //$ is a function called jquery which takes a string parameter called the selector
//#indicates that looking for an element with an id of the following name, ie SaveID
//.click is a method that takes a function parameter which does what we want to happen when we click on SaveID
alert("Hello "+ $("#NameID").val()); //.val is a method with no arguments which returns the current value of the object found via the $
});
</script>
</body>
</html>