How to activate setInterval() incase a text control has the focus
<p>Actually I have an update enquery into this point .</p>

<p>I have smth like that :</p>

<pre><code>$(document).ready(function() {

setInterval(doSmth, 10000);
 function doSmth() {
        var result = document.getElementById("fooText").value;
        if (result != "") {            
                    doSmthElse(result);
                }
            });
        }
    }
});
</code></pre>

<p>I need to activate the interval ,that is fired each 10 seconds, in case only a text control has the focus else do nothing !!</p>
