-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.js
More file actions
34 lines (27 loc) · 836 Bytes
/
Copy pathfunction.js
File metadata and controls
34 lines (27 loc) · 836 Bytes
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
let mph = 0
document.getElementById('localstorageid').addEventListener('click', n);
function speedConverter() {
mph = Number(document.getElementById("mph").value);
let kmph = speedConverter1(mph);
localStorage.setItem('key',kmph);
document.getElementById('result').innerHTML = kmph +' KMPH';
}
function speedConverter1(mph) {
temp = parseFloat(mph)
let kmph = temp * 1.6;
return kmph;
}
function loadDoc() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML =
this.responseText;
}
};
xhttp.open("GET", "harsha_info.txt", true);
xhttp.send();
}
function localSet(){
document.getElementById('lc').value=localStorage.getItem('key');
}