Submit templates for repl.it/templates here.

← Back to all posts
real time updating text
ETHANTHOMAS9

this is a very simple program that will update the html on the website in real-time as you type it. you could use it as a template for an effect on a larger website.

Voters
FauxElements
SilvermoonCat
MemeManHimself
yuhuiguo
techgeek680
SilentShadowBla
SpaceFire
MarblesAndMore
Wilke000
AgastyaSandhuja
Comments
hotnewtop
syflexer

thats a cool concept

ETHANTHOMAS9

@syflexer thanks! I'm probably going to save it all to a function so that other people can use it more easily if they want.

syflexer

@ETHANTHOMAS9 That makes sense it seems like it could be used well with a search bar

[deleted]

Input this: <img onerror="alert(1)" src=x>

techgeek680

wow!

ChristianMMacy

This is a great demo! Using setInterval to check the value every millisecond is very inefficient, so you might consider changing what you're listening for. You can actually listen for "keyup" instead so that the check only triggers when a keyboard key has been pressed and released. It will result in the same effect, but without a looping event executing every millisecond :-)

ETHANTHOMAS9

@ChristianMMacy I made this when I was relatively new to JavaScript. I later remade this using the "input" event on the event listener. That way I could get rid of the setInterval function entirely.

Wilke000

So cool :-)

yuhuiguo

cool