-
Notifications
You must be signed in to change notification settings - Fork 0
/
testing.html
43 lines (29 loc) · 984 Bytes
/
testing.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
43
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>
<p id="testing"></p>
<p id="myElement" onclick="changeText(this)">Hi there, testing: click on this</p>
<p id="jquerystuff">Jquery is it awesome?</p>
<script>
//learning about javascript: change inner html
document.getElementById("testing").innerHTML = ("BOO");
var storedText = document.getElementById("myElement").innerHTML;
//learning about javascript: make something change on click
function changeText(id) {
if (id.innerHTML == storedText)
id.innerHTML = "I believe in magic!";
else
id.innerHTML = storedText;
}
// function changeText2(idElement) {
// $('#jquerystuff').onclick
// }
//create a websocket connecting to server
//Possibly put user info in seperate file for GIT?
// hosturl = "mood.gretaparks.com"
// var websocket = new WebSocket(hosturl)
</script>
</body>
</html>