How to Create Animated Typing Effect using typed.js? Last Updated : 24 Jul, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report Typed.js is a JavaScript library that is used to type a set of strings at the speed that you set, backspace what it's typed, and begin the typing with another string you have set.Let us start by creating a project folder and name it as per your wish. Create two files and name them as "index.html" and "style.css"Write the following code in "index.html" HTML <!DOCTYPE html> <html lang="en"> <head> <title>Typed.js</title> <!-- Import style.css from root directory --> <link rel="stylesheet" href="./style.css" /> </head> <body> <div class="heading"> <h1>GeeksforGeeks</h1> <h3> <span class="text-slider-items"> A computer Science portal for geeks, A place to practice code </span> <strong class="text-slider"></strong> <!-- classes "text-slider" and "text-slider-items" for typed.js script --> </h3> </div> </body> </html> Write the following CSS code into your "style.css" file. CSS body { background-color: white; font-family: Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; } .text-slider-items { display: none; } .heading { margin-top: 200px; text-align: center; } .heading h1 { color: limegreen; font-size: 70px; } .heading h3 { color: black; font-size: 20px; } Now you have to download the "typed.js" scripts folder from the below link and unzip it and keep it in your project directory.Download Link: https://mattboldt.com/demos/typed-js/Also, you have to include a jQuery library to use jQuery functions. There are two ways either by downloading and adding the "jquery.js" file or by adding its CDN file link. Here you will add jQuery by using the CDN link.CDN link: https://developers.google.com/speed/libraries/devguide#jqueryWe have to import and add the "typed.js" file from the "typed.js" folder. Add all JavaScript files just before the "body" tag. Also add the below script into your "index.html" file. HTML <script src="./typed.js-master/lib/typed.min.js"> </script> <script src="https://ajax.googleapis.com/ajax/libs/ jquery/3.5.1/jquery.min.js"> </script> <script> if ($(".text-slider").length == 1) { var typed_strings = $(".text-slider-items").text(); var typed = new Typed(".text-slider", { strings: typed_strings.split(", "), typeSpeed: 50, loop: true, backDelay: 900, backSpeed: 30, }); } </script> It should look like this. HTML <!DOCTYPE html> <html lang="en"> <head> <title>Typed.js</title> <!-- Import style.css from root directory --> <link rel="stylesheet" href="./style.css" /> </head> <body> <div class="heading"> <h1>GeeksforGeeks</h1> <h3> <span class="text-slider-items"> A computer Science portal for geeks, A place to practice code </span> <strong class="text-slider"></strong> </h3> </div> <!-- Import typed.min.js file from typed.js folder --> <script src= "./typed.js-master/lib/typed.min.js"> </script> <!-- Add jquery cdn --> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"> </script> <!-- Add this script for successful implementation of typed.js --> <script> if ($(".text-slider").length == 1) { var typed_strings = $(".text-slider-items").text(); var typed = new Typed(".text-slider", { strings: typed_strings.split(", "), typeSpeed: 50, loop: true, backDelay: 900, backSpeed: 30, }); } </script> </body> </html> Start the "index.html" file and notice the output.Output:Â Comment More infoAdvertise with us Next Article How to Create Animated Typing Effect using typed.js? M Malhar_37 Follow Improve Article Tags : JavaScript CSS-Misc HTML-Misc JavaScript-Misc Similar Reads JavaScript Tutorial JavaScript is a programming language used to create dynamic content for websites. It is a lightweight, cross-platform, and single-threaded programming language. It's an interpreted language that executes code line by line, providing more flexibility.JavaScript on Client Side: On the client side, Jav 11 min read JavaScript Interview Questions and Answers JavaScript is the most used programming language for developing websites, web servers, mobile applications, and many other platforms. In Both Front-end and Back-end Interviews, JavaScript was asked, and its difficulty depends upon the on your profile and company. Here, we compiled 70+ JS Interview q 15+ min read Introduction to JavaScript JavaScript is a versatile, dynamically typed programming language used for interactive web applications, supporting both client-side and server-side development, and integrating seamlessly with HTML, CSS, and a rich standard library.JavaScript is a single-threaded language that executes one task at 7 min read JSON Web Token (JWT) A JSON Web Token (JWT) is a standard used to securely transmit information between a client (like a frontend application) and a server (the backend). It is commonly used to verify users' identities, authenticate them, and ensure safe communication between the two. JWTs are mainly used in web apps an 7 min read Frontend Developer Interview Questions and Answers Frontend development is an important part of web applications, and it is used to build dynamic and user-friendly web applications with an interactive user interface (UI). Many companies are hiring skilled Frontend developers with expertise in HTML, CSS, JavaScript, and modern frameworks and librarie 15+ min read JavaScript Coding Questions and Answers JavaScript is the most commonly used interpreted, and scripted Programming language. It is used to make web pages, mobile applications, web servers, and other platforms. Developed in 1995 by Brendan Eich. Developers should have a solid command over this because many job roles need proficiency in Jav 15+ min read Top 95+ Javascript Projects For 2025 JavaScript is a lightweight, cross-platform programming language that powers dynamic and interactive web content. From real-time updates to interactive maps and animations, JavaScript brings web pages to life.Here, we provided 95+ JavaScript projects with source code and ideas to provide hands-on ex 4 min read Functions in JavaScript Functions in JavaScript are reusable blocks of code designed to perform specific tasks. They allow you to organize, reuse, and modularize code. It can take inputs, perform actions, and return outputs.JavaScriptfunction sum(x, y) { return x + y; } console.log(sum(6, 9)); // output: 15Function Syntax 5 min read JavaScript Exercises, Practice Questions and Solutions JavaScript Exercise covers interactive quizzes, tracks progress, and enhances coding skills with our engaging portal. Ideal for beginners and experienced developers, Level up your JavaScript proficiency at your own pace. Start coding now! A step-by-step JavaScript practice guide for beginner to adva 3 min read HTML DOM (Document Object Model) The HTML DOM (Document Object Model) is a programming interface that represents the structure of a web page in a way that programming languages like JavaScript can understand and manipulate. Think of it as a tree of objects where each part of your HTML document (elements, attributes, text) is repres 6 min read Like