在asp里一个需要填写的表单在打开的时候就自动填上字

来源:百度知道 编辑:UC知道 时间:2024/04/29 22:50:58
比如说我一打开1.html页面时在名字这个表单上就会出现小张
<form action="" method="post">
名字:<input type="text" name="name">
密码:<input type="password" name="pass">
<input type="submit" value="提交 ">

如果想把光标放到该文本域,字符就消失的话:
<form action="" method="post">
名字:<input type="text" name="name" value="小张" onfocus="this.value=''">
密码:<input type="password" name="pass">
<input type="submit" value="提交 ">

<form action="" method="post">
名字:<input type="text" name="name" value="小张">
密码:<input type="password" name="pass">
<input type="submit" value="提交 ">