0
Hey! I want to make a typing effect on a code with code box ,what I want to do?
Please give reply to my question
2 Respuestas
+ 2
Prajwal Paratkar Try to google it first, then ask
https://www.w3schools.com/howto/howto_js_typewriter.asp
https://code.sololearn.com/W0uW3Wks8UBk/?ref=app
+ 1
Prajwal Paratkar
<div style="color:white;background-color:black;width:270px;height:50px;padding:20px;word-break:break-word;">
<code id="fx"></code
</div>
<script>
const txt = "There is a fine line between asking for help and just being lazy...";
let i= 0;
function typeWriter(){
if (i < txt.length) {
fx.textContent += txt.charAt(i);
i++;
setTimeout(typeWriter, 100);
}
}
typeWriter();
</script>