-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpalindrome.html
More file actions
38 lines (31 loc) · 870 Bytes
/
palindrome.html
File metadata and controls
38 lines (31 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
Enter any Number: <input id="no_input">
<button onclick="palin()">Check</button></br></br>
<script>
function palin() {
var a, no, b, temp = 0;
no = Number(document.getElementById("no_input").value);
b = no;
while (no > 0) {
a = no % 10;
no = parseInt(no / 10);
temp = temp * 10 + a;
}
if (temp == b) {
alert("Palindrome number");
}
else {
alert("Not Palindrome number");
}
}
</script>
</body>
</html>