JSFiddle - React, Tailwind, and code Playground

by painotpi

HTML

<div id="target">
    <input type="text" value="0" />
</div>

JavaScript

var count = $("#target input[type='text']").val();
var fun = function () {

    console.log("Here", count);
    
    count += count;
    
    $("#target input[type='text']")[0].value = count;
    
    console.log("Here", count);

    setTimeout(fun, 1000);

}

fun();