Wednesday, January 11, 2012

How to activate setInterval() incase a text control has the focus


Actually I have an update enquery into this point .



I have smth like that :




$(document).ready(function() {

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



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

No comments:

Post a Comment