JavaScript Programming Get a Square root of a given number with that code Square Root Convert Using Math.sqrt Square Root Calculator Enter a number Calculate square root Square root
JavaScript
<!DOCTYPE html>
<html>
<head>
<!--
-->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>Square Root</title>
<link rel="stylesheet" href="styles.css" />
<script src="modernizr.custom.05819.js"></script>
</head>
<body>
<header>
<h1>
Convert Using Math.sqrt
</h1>
</header>
<article>
<h2>Square Root Calculator</h2>
<form>
<fieldset>
<label for="mValue">
Enter a number
</label>
<input type="number" id="value" />
</fieldset>
<fieldset>
<button type="button" id="convertButton">Calculate square root</button>
</fieldset>
<fieldset>
<p>Square root</p>
<p id="sqRoot"></p>
</fieldset>
</form>
</article>
<script>
// YOUR CODE HERE
</script>
</body>
</html>

Step by step
Solved in 4 steps with 2 images









