Type Writting Code animation
Thu Dec 19 2024 11:05:25 GMT+0000 (Coordinated Universal Time)
Saved by
@Huzaifa
<script>
document.addEventListener("DOMContentLoaded", function () {
const marqueeElement = document.querySelector(".marquee");
const text = marqueeElement.textContent;
const speed = 200;
marqueeElement.textContent = ""; // Clear the text initially
let index = 0;
function typeWriter() {
if (index < text.length) {
marqueeElement.textContent += text.charAt(index);
index++;
setTimeout(typeWriter, speed);
}
}
typeWriter();
});
</script>
content_copyCOPY
Comments