File size: 765 Bytes
1484ca4
 
280401e
 
 
 
 
 
 
 
 
 
 
7f828eb
280401e
 
 
 
 
86bd250
12d76be
86bd250
280401e
 
86bd250
280401e
 
 
 
1484ca4
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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">

</head>
<body>

<h1>Square Roots</h1>
<p>Drag the slider to display the square root.</p>

<div class="slidecontainer">
  <input type="range" min="1" max="100" value="50" class="slider" id="myRange">
  <p>Square root of <span id="PickedNumber"></span> is <span id="demo"></span></p>
</div>

<script>
var slider = document.getElementById("myRange");
var output = document.getElementById("demo");
var output2 = document.getElementById("PickedNumber");
output.innerHTML = Math.sqrt(slider.value);
output2.innerHTML = slider.value;
slider.oninput = function() {
  output.innerHTML = Math.sqrt(this.value) ;
  output2.innerHTML = this.value;
}
</script>

</body>
</html>