Codingrocks3/SquareRoots
0
1<!DOCTYPE html>2<html>3<head>4<meta name="viewport" content="width=device-width, initial-scale=1">5 6</head>7<body>8 9<h1>Square Roots</h1>10<p>Drag the slider to display the square root.</p>11 12<div class="slidecontainer">13 <input type="range" min="1" max="100" value="50" class="slider" id="myRange">14 <p>Square root of <span id="PickedNumber"></span> is <span id="demo"></span></p>15</div>16 17<script>18var slider = document.getElementById("myRange");19var output = document.getElementById("demo");20var output2 = document.getElementById("PickedNumber");21output.innerHTML = Math.sqrt(slider.value);22output2.innerHTML = slider.value;23slider.oninput = function() {24 output.innerHTML = Math.sqrt(this.value) ;25 output2.innerHTML = this.value;26}27</script>28 29</body>30</html>31 