0

i want to add an underscore to the div element every second, it only appears to happen once.

Code:

let input = document.createElement("DIV")
let space = document.createTextNode("_")

input.style.backgroundColor = "white"
input.style.width = "100%"
input.contentEditable = "true"

document.body.appendChild(input)

setInterval(function(){input.appendChild(space) }, 5000);
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
toady
  • 1

0 Answers0