after clicking on a button I am reading text within span tag and printing into the input box. here what I want to achieve is on clicking on the button I want to print the first character which is 'H' and after 1 sec pass, I want to print 'e' and so on till string finish. I want to use keyup and trigger jquery functionality within it.
till now what I tried is. any help really appreciated.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>trigger demo</title>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<div><span class="hello">Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world </span></div>
trigger above text here: <input type="text" name="fname" id="input1">
<button class="world">trigger</button>
<br>
<script>
$( ".world" ).click(function() {
setInterval(function(){
var hello = $( ".hello" ).text();
console.log(hello);
var a = $('#input1').trigger('keyup');
console.log(a); }, 1000);
});
</script>
</body>
</html>