-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjs_task1.html
23 lines (23 loc) · 1000 Bytes
/
js_task1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JS task 1</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
<script>
function reverse(x){
document.getElementById('restr').innerHTML=x.toString().split("").reverse().join("");
}
</script>
</head>
<body>
<div class="container">
<h1 class="text-center mt-5">Reverse number x:</h1>
<input type="text" id="str" class="form-control mt-5">
<button id="reverse" class="btn btn-dark my-4 d-block mx-auto" onclick="reverse(document.getElementById('str').value)">Reverse</button>
<p id="restr"></p>
</div>
</body>
</html>