-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
49 lines (41 loc) · 1.58 KB
/
main.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
function f1() {
//function to make the text bold using DOM method
document.getElementById("textarea").style.fontWeight = "bold";
}
function f2() {
//function to make the text italic using DOM method
document.getElementById("textarea").style.fontStyle = "italic";
}
function f3() {
//function to make the text alignment left using DOM method
document.getElementById("textarea").style.textAlign = "left";
}
function f4() {
//function to make the text alignment center using DOM method
document.getElementById("textarea").style.textAlign = "center";
}
function f5() {
//function to make the text alignment right using DOM method
document.getElementById("textarea").style.textAlign = "right";
}
function f6() {
//function to make the text in Uppercase using DOM method
document.getElementById("textarea").style.textTransform = "uppercase";
}
function f7() {
//function to make the text in Lowercase using DOM method
document.getElementById("textarea").style.textTransform = "lowercase";
}
function f8() {
//function to make the text capitalize using DOM method
document.getElementById("textarea").style.textTransform = "capitalize";
}
function f9() {
//function to make the text back to normal by removing all the methods applied
//using DOM method
document.getElementById("textarea").style.fontWeight = "normal";
document.getElementById("textarea").style.textAlign = "left";
document.getElementById("textarea").style.fontStyle = "normal";
document.getElementById("textarea").style.textTransform = "capitalize";
document.getElementById("textarea").value = " ";
}