Keyup

For example, consider the HTML:

Demo

Output



HTML

<input type="text" value="" id="title" placeholder="Type here">
<h2>Output</h2>
<div id="contentArea"></div>

Javascript

    function titlePreview(){
        var getTitle = $('#title').val()
        writeTitle = '<div id="contentArea">'+getTitle+'</div>';
        document.getElementById('contentArea').innerHTML = (writeTitle);
    }
    
    $( "#title" ).keyup(function() {
        titlePreview()
    });

Copyright 2023 by WebiBeris.com. All Rights Reserved.