-
Notifications
You must be signed in to change notification settings - Fork 0
/
style.js
72 lines (47 loc) · 1.73 KB
/
style.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
64
65
66
67
68
69
70
71
72
$(document).ready(function () {
$(".changetext").hide();
$(".loader").hide();
$("#btn").click(function () {
$(".loader").show().delay(2000).hide("slow");
});
$("#btn2").click(function () {
$(".changetext").hide();
$(".loader").show().delay(2000).hide("slow");
$(".changetext").delay(2000).show(300);
});
$("#btn3").click(function () {
$(".changetext").hide();
$(".loader").show().delay(2000).hide("slow");
$(".changetext").delay(2000).show(300);
});
});
var btn1 = document.getElementById('btn').addEventListener("click", counters);
var btn2 = document.getElementById('btn2').addEventListener("click", lowercase);
var btn3 = document.getElementById('btn3').addEventListener("click", uppercase);
//FUnction to count the characters and words
function counters() {
let txt = document.getElementById('texts')
let newtxt = txt.value
document.getElementById('chr').innerText = "Total charcters : " + newtxt.length
const myArray = newtxt.split(" ");
let counter = myArray.length;
document.getElementById('word').innerText = "Total words : " + counter
}
//function to turn any text into lowerCase
function lowercase() {
let txt = document.getElementById('texts').value
let a = document.getElementById('newtext').innerText = txt.toLowerCase();
}
//function to turn any text into UpperCase
function uppercase() {
let txt = document.getElementById('texts').value
let a = document.getElementById('newtext').innerText = txt.toUpperCase();
}
var myVar;
function myFunction() {
myVar = setTimeout(showPage, 3000);
}
//animation hide function
function showPage() {
document.getElementById("loader").style.display = "none";
}