J L,
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script> function pow2(){
alert(document.getElementById('inp1').value*document.getElementById('inp1').value);}</script>
</head>
<body>
<p>
vvedite cislo: <input type="text" id="inp1">
<button onclick="pow2()">Kvadrat</button>
</p>
</body>
</html>