Skip to content

Commit 57be59f

Browse files
committed
Create index.html
1 parent b3e0e3e commit 57be59f

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

web/index.html

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!DOCTYPE HTML>
2+
<html>
3+
<head>
4+
<title> My Programs in JavaScript </title>
5+
<script>
6+
7+
function captwords() {
8+
9+
var fs ="";
10+
var list="z6amTPcq z1UiI 6sS0DNaXdzwszSsLw4W8JxsDIH5LXPPQ"+"<br>"+"VfTuw5dIL9QyUP bMuP JWkasF GE9jhXLo9lnAbPfYoH";
11+
list.split("\n").forEach( function(line){
12+
if(line !== "") {
13+
var words = line.split(" ");
14+
for(var i = 0; i < words.length; ++i){
15+
var letter = words[i][0];
16+
17+
if(letter <= 'z'&& letter >= 'a'){
18+
letter = String.fromCharCode(letter.charCodeAt()-32);
19+
}
20+
21+
//alert("Caught: "+" \n "+letter+" in "+words[i]);
22+
fs = fs + letter + words[i].substr(1) + " ";
23+
}
24+
25+
fs = fs + "<br>";
26+
}
27+
28+
});
29+
30+
document.getElementById("demo").innerHTML="Input: "+"<br>"+list;
31+
document.getElementById("result").innerHTML="Results: "+"<br>"+fs;
32+
}
33+
</script>
34+
</head>
35+
36+
<body>
37+
38+
39+
<p id="demo">Result</p> <br><br>
40+
<p id="result">Answer</p>
41+
42+
<button type="button" onclick="captwords()">My Capitalize Words function!</button>
43+
44+
</body>
45+
46+
47+
</html>

0 commit comments

Comments
 (0)