<input type="text" id="inputid" placeholder=""/>
body {
  background: #fff;
  color: #000;
  font-family: monospace;
  font-size: 24px;
}
const text = [
  'Ты у меня одна',
  'Словно в ночи луна',
  'Словно в году весна',
  'Словно в степи сосна'
];

 let line = 0;
  let count = 0;
  let result = '';
  function typeLine() {
    let interval = setTimeout(
      () => {
        result += text[line][count]
        document.querySelector('#inputid').placeholder =result;


      count++;
      if (count >= text[line].length) {
        count = 0;
        line++;
        result = '';
        if (line == text.length) {
          clearTimeout(interval);
          document.querySelector('#inputid').placeholder =result;
          line = 0;
          count = 0;
          result = '';
          typeLine();
          return true;
        }
      }
      typeLine();
    }, getRandomInt(getRandomInt(250*2.5)))
  }
  typeLine();

function getRandomInt(max) {
  return Math.floor(Math.random() * Math.floor(max));
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.