javascript实现页面刷新时自动清空表单并选中的方法,涉及javascript中reset与focus方法的相关使用技巧。
<script language="javascript">
window.onload=function() {
document.forms[0].reset();
placeFocus();
}
function placeFocus() {
document.forms[0].elements[0].focus();
// assuming the first element
}
</script>