Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
Latest commit
32 lines (29 loc) · 1.13 KB
/
Copy pathindex.html
File metadata and controls
32 lines (29 loc) · 1.13 KB
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
<!DOCTYPE html>
<html>
<head>
<title>JS</title>
</head>
<body>
<!-- Here we make two text input boxes, and we're
giving them values just so that we don't have to
type numbers in everytime we refresh the page.
The id's are how we'll reach the value in the box
in our javascript file. -->
<inputtype="text" value="1" id="num1">
<inputtype="text" value="2" id="num2">
<!-- The onclick="add()" will run our function in
the javascript file.-->
<buttontype="button" name="button" onclick="add()">submit</button>
<!-- This is where we'll update our answer. Make
sure your id is correct.-->
<pid="label"></p>
<!-- This is where we tell the brower, hey, make sure
to check out our javascript file so that you know what
actions to take. We put this at the bottom of the HTML and
not the top in the head like we would if it were CSS because
it's better for the loading time of our page. If you want,
you can put it on the top of the top, it will work, but it's
not recommended. -->
<scripttype="text/javascript" src="script.js"></script>
</body>
</html>