Skip to content

Commit 84eb755

Browse files
authored
Update index.html
1 parent 355960e commit 84eb755

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

index.html

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,6 @@
33
<head>
44

55
<script src='https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.4/socket.io.js'></script>
6-
7-
<script>
8-
9-
var socket = io();
10-
11-
socket.on('data', function(data) {
12-
13-
console.log(data);
14-
15-
document.getElementById('sample').style.opacity = data+"%";
16-
17-
});
18-
19-
</script>
206

217
<style>
228

@@ -35,5 +21,19 @@ <h1>Communicating from an Arduino to Node.js</h1>
3521

3622
<div id="sample"></div>
3723

24+
<script>
25+
26+
var socket = io();
27+
28+
socket.on('data', function(data) {
29+
30+
console.log(data);
31+
32+
document.getElementById('sample').style.opacity = data+"%";
33+
34+
});
35+
36+
</script>
37+
3838
</body>
3939
</html>

0 commit comments

Comments
 (0)