Typing effect using HTML,CSS JS

Hello everyone, welcome to mradvancetechnical, today we are going to learn about typing effect using HTML,CSS,JS

we will be using simple way to implement this.

Where to use Typing effect.

if you are making a portfolio site OR want to add some feature on your existing site then you can use this.

so without wasting the time let's get started here is a code to implement such effect.





<!DOCTYPE html>
<html>
<head>
<title>typing effect in js</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1 class="genrate"><b></b> </h1>
</body>
<script src="script.js"></script>
</html>
view raw index.html hosted with ❤ by GitHub
let a="Welcome";
let v=0;
var uniqueid=setInterval(create,230);
// setInterval() will call create() after every 230ms.
function create(){
var grettings=document.getElementsByClassName("genrate");
//check if counter variable V and string length is same then clearInterval()
if(a.length==v)
clearInterval(uniqueid);
else{
//appending character
grettings[0].append(a[v]);
v++;
}
}
view raw script.js hosted with ❤ by GitHub
.genrate{
text-align: center;
font-size: 10em;
color: white;
font-family: 'Segoe UI';
}
body{
background-color: black;
}
view raw style.css hosted with ❤ by GitHub

No comments: