Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
10 views2 pages

New Text Document

This document is an HTML page for a web application that reverses the digits of a number input by the user. It includes a styled interface with a title, input field, button, and output area, along with CSS for visual enhancements and JavaScript for functionality. The application prompts the user to enter a number and displays the reversed digits upon clicking the button.

Uploaded by

syediliyas8282
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

New Text Document

This document is an HTML page for a web application that reverses the digits of a number input by the user. It includes a styled interface with a title, input field, button, and output area, along with CSS for visual enhancements and JavaScript for functionality. The application prompts the user to enter a number and displays the reversed digits upon clicking the button.

Uploaded by

syediliyas8282
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

<!

DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Reverse Number Digits</title>
<style>
body {
font-family: 'Segoe UI', sans-serif;
background: linear-gradient(to right, #e0f7fa, #fce4ec);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
color: #333;
margin: 0;
}

.container {
background: white;
padding: 30px 40px;
border-radius: 12px;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
text-align: center;
max-width: 500px;
width: 100%;
animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
from { opacity: 0; transform: translateY(-20px); }
to { opacity: 1; transform: translateY(0); }
}

h1 {
color: #00796b;
font-size: 28px;
margin-bottom: 20px;
}

input[type="number"] {
width: 80%;
padding: 12px;
margin-top: 10px;
font-size: 16px;
border: 1px solid #ccc;
border-radius: 8px;
transition: border-color 0.3s;
}

input:focus {
border-color: #26a69a;
outline: none;
}

button {
margin-top: 20px;
padding: 12px 24px;
font-size: 16px;
border: none;
border-radius: 8px;
background-color: #00796b;
color: white;
cursor: pointer;
transition: background-color 0.3s;
}

button:hover {
background-color: #004d40;
}

#output {
margin-top: 25px;
font-size: 18px;
color: #444;
}

footer {
margin-top: 40px;
font-size: 14px;
color: #888;
}
</style>
</head>
<body>

<div class="container">
<h1><u>Reverse Number Digits</u></h1>
<input type="number" id="inputNumber" placeholder="Enter a number" />
<br>
<button onclick="reverseNumber()">Reverse Digits</button>
<p id="output"></p>
</div>

<footer>&copy; 2025</footer>

<script>
function reverseNumber() {
const num = document.getElementById("inputNumber").value;
if (num === "") {
document.getElementById("output").textContent = "Please enter a valid
number.";
return;
}

const reversedNum = num.split('').reverse().join('');


document.getElementById("output").textContent = `Reversed Number: $
{reversedNum}`;
}
</script>

</body>
</html>

You might also like