Text Editor using Input event

HTML

<body>
    <h1>Text Editor</h1>
    <p></p>
    <input type="text" id="text" /><br />

CSS

// TEXT EDITOR USING INPUT EVENT
let inp=document.querySelector("#text");
let p=document.querySelector("p");

inp.addEventListener("input",function(){
    console.log(this.value);
    p.innerText=inp.value;
});


Comments

Popular posts from this blog

Callback Hell

TODO list with DOM

Refactoring callback hell code