-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathalphabet.js
More file actions
47 lines (38 loc) · 1.09 KB
/
alphabet.js
File metadata and controls
47 lines (38 loc) · 1.09 KB
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
39
40
41
42
43
44
45
46
jQuery(document).ready(function($) {
console.log($('#abcbox').val())
$('#button1').click(function() {
$('#abcbox').val('');
abc();
});
$('#button2').on('click', function() {
$('body').toggleClass('wow');
})
});
/**
* Created by Ben Vaughan on 7/10/2014.
*/
// split the alphabet, display every other letter.
// Every third letter that is display needs to be capitalized.
function abc() {
var abc = 'abcdefghijklmnopqrstuvwxyz';
var arr = abc.split('');
var t = 1;
var content ='';
for (i = 0; i < arr.length; i++) {
if (i % 2 === 0) {
if (t === 3) {
console.log(arr[i].toUpperCase());
// document.write(arr[i].toUpperCase() + ", ");
content = content + arr[i].toUpperCase() + ", ";
t = 1;
} else {
console.log(arr[i]);
// document.write(arr[i] + ", ");
content = content + arr[i] + ", ";
t++;
}
}
}
console.log(content);
$('#abcbox').val(content);
}