-
Notifications
You must be signed in to change notification settings - Fork 9
/
home.js
63 lines (40 loc) · 1.44 KB
/
home.js
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
function f1(){
document.getElementById("textarea1").style.fontWeight="bold";
}
function f2(){
document.getElementById("textarea1").style.fontStyle = "italic";
}
function f3(){
document.getElementById("textarea1").style.textAlign = "left";
}
function f4(){
document.getElementById("textarea1").style.textAlign = "center";
}
function f5(){
document.getElementById("textarea1").style.textAlign = "right";
}
function f6(){
document.getElementById("textarea1").style.textTransform = "uppercase";
}
function f7(){
document.getElementById("textarea1").style.textTransform = "lowercase";
}
function f8(){
document.getElementById("textarea1").style.textTransform = "capitalize";
}
function f9(){
document.getElementById("textarea1").style.fontWeight = "normal";
document.getElementById("textarea1").style.textAlign = "left";
document.getElementById("textarea1").style.fontStyle = "normal";
document.getElementById("textarea1").style.textTransform = "capitalize";
document.getElementById("textarea1").value=" ";
}
function f10() {
const content = document.getElementById("textarea1").value;
var save = document.createElement("a");
save.setAttribute("href", "data:text/plain;charset=umenttttf-8," + encodeURI(content));
save.setAttribute("download", content.slice(0, 17) + ".txt");
document.body.appendChild(save);
save.click();
document.body.removeChild(save);
}