/
index.html
36 lines (35 loc) · 1.49 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>This is a Test Electron App!</title>
</head>
<body>
<h1>Test Electron App for JIBO!</h1>
We are using node <script>document.write(process.versions.node)</script>,
Chrome <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.
<!-- //Objectives
// Please modify the Electron app you built to have two buttons.
// If you click one button, it shows a random number in a text box.
// When you click the other button, it shows the word "Hello World" in the box (this will be our error case).
//
// Create a test that clicks first one button then the other and checks to make sure
// that what is in the box is a valid number.
// If it's not a valid number, then the test has failed. -->
<input type="button" id='ButtonA' value="ButtonA" onclick="return changeToRandomNumber(document.getElementById('sampleTextBox'));" />
<input type="button" id='ButtonB' value="ButtonB" onclick="return changeToHello(document.getElementById('sampleTextBox'));" />
<script type="text/javascript">
function changeToHello( textBox ){
textBox.value = '';
textBox.value = 'Hello World';
};
function changeToRandomNumber(textBox){
//textBox.type = 'number';
textBox.value = '';
textBox.value = Math.random();
};
</script>
<input type="text" id="sampleTextBox"><br>
</body>
</html>