< script language="javascript">
function func()
{
var t2 = document.getElementById("t2");
t2.focus();
t2.value = t2.value;
}
< /script>
The trick is to reset the value of the textbox like that:
t2.value = t2.value;
Don’t put a focus() method after that line, as it won’t work. If you want to focus the control do it before you reset the value.
Advertisement