有时候在制作网页表单时需要在用户打开表单页时自动为某个文本框设置焦点,如何实现呢?来看个例子。
首先制作输入页:
<form method=”post” action=”xxxx.php” name=”login_form” target=”_top” class=”login”>
<div class=”xxxx”>
<label for=”input_username”>登入名称:</label>
<input type=”text” name=”pma_username” id=”input_username” value=”root” size=”24″ class=”textfield” />
</div>
<div class=”item”>
<label for=”input_password”>密码:</label>
<input type=”password” name=”pma_password” id=”input_password” …