random typewriter effect using js
this isnt super hard ig? just requires some knowledge about the DOM(document object model) and how to assign stuff to stuff in js
1. have element you wanna do the typewriter effect on. give it an id of whatever you want, i gave it the id of js.
2. create script tags at the bottom of the page using <script> </script>.
in between them, put in the code
const text = "Placeholder"
function writeText(){
var x = document.getElementById("js");
x.innerText = text.slice(0, index);
if (index > (text.length + 1 ))
setInterval(writeText, 500);
this creates a function that writes the text in the text variable(Placeholder) every 500 milliseconds, and when index = 0, it resets.
change placeholder to your liking and don’t forget to change the id!
hope this helped, check out my codepen + my github
drop me an ask if you need any help!