-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2.6.html
More file actions
31 lines (27 loc) · 733 Bytes
/
Copy path2.6.html
File metadata and controls
31 lines (27 loc) · 733 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
<DOCTYPE! html>
<html>
<head>
<meta charset="UTF-8" ; />
<title>2.2</title>
</head>
<body>
<script>
function checkPalindrome(word) {
var l = word.length;
for (var i = 0; i < l / 2; i++) {
if (word.charAt(i) !== word.charAt(l - 1 - i)) {
return false;
}
}
return true;
}
if (checkPalindrome("assa")) {
document.write("The word is a palindrome");
} else {
document.write("The word is NOT a palindrome");
}
</script>
</body>
</head>
</html>
</DOCTYPE!>