forked from thefivetoes/js-beginner-01
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
26 lines (26 loc) · 1.12 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
<html>
<head>
<script src="script.js"></script>
<link rel="stylesheet" href="styles.css" type="text/css">
</head>
<body>
<h1>JavaScript Beginner 01</h1>
<span>Instructions:</span>
<ol>
<li>Define a function max() that takes two numbers as arguments and returns the largest of them. Use the if-then-else construct available in Javascript. </li>
<li>Log the result in the console.</li>
</ol>
<div id="answer-container">
<h2>Solution</h2>
<div>
<form action="" onsubmit="checkMaxValue(); return false;">
<p>Enter a number.</p>
<label for="value-one">Value one: </label><input title="Numbers & decimals only!" type="text" id="value-one" pattern="(-?)[0-9]+([\.|,][0-9]+)?" /><br/>
<label for="value-two">Value two: </label><input title="Numbers & decimals only!" type="text" id="value-two" pattern="(-?)[0-9]+([\.|,][0-9]+)?" /><br />
<button type="submit" id="value-compare-button">Which is the max?</button>
<p id="result-message"></p>
</form>
</div>
</div>
</body>
</html>