SquareRoots / index.html
Codingrocks3's picture
Update index.html
12d76be
raw
history blame
600 Bytes
<!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>Value: <span id="demo"></span></p>
</div>
<script>
var slider = document.getElementById("myRange");
var output = document.getElementById("demo");
output.innerHTML = Math.sqrt(slider.value);
slider.oninput = function() {
output.innerHTML = Math.sqrt(this.value) ;
}
</script>
</body>
</html>