nput文本框 鼠标点击默认值消失,不输入离开鼠标恢复默认值
上一篇 /
下一篇 2012-07-05 10:46:13
/ 个人分类:web
table width="230" border="0" cellpadding="2" cellspacing="1" bgcolor="#cccccc">
<FORM. id="form1" method="post" name="form1" action="uaeraction.php" >
<tr>
<td colspan="2" bgcolor="#FFFFFF"> <textarea name="remark" cols="40" rows="4" id="remark" style="font:12px; color:#000" nFocus="if (value =='<--请输入留言内容-->'){value =''}" nBlur="if (value ==''){value='<--请输入留言内容-->'}" value="<--请输入留言内容-->"></textarea></td>
</tr>
<tr>
<td width="21" bgcolor="#FFFFFF"><img src="images/xm.jpg" /></td>
<td width="173" bgcolor="#FFFFFF"><input name="fullname" type="text" id="fullname" style="font:12px; color:#000" nFocus="if (value =='<--请输入姓名-->'){value =''}" nBlur="if (value ==''){value='<--请输入姓名-->'}" value="<--请输入姓名-->" size="20" maxlength="20"/></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><img src="images/dh.jpg" /></td>
<td bgcolor="#FFFFFF"><input name="phone" type="text" id="phone" style="font:12px; color:#000" nFocus="if (value =='<--请输入电话-->'){value =''}" nBlur="if (value ==''){value='<--请输入电话-->'}" value="<--请输入电话-->" size="20" maxlength="20"/></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><img src="images/dz.jpg" /></td>
<td bgcolor="#FFFFFF"><input name="address2" type="text" id="address2" style="font:12px; color:#000" nFocus="if (value =='<--请输入地址-->'){value =''}" nBlur="if (value ==''){value='<--请输入地址-->'}" value="<--请输入地址-->" size="20" maxlength="50"/></td>
</tr>
<tr>
<td colspan="2" bgcolor="#FFFFFF"><input type="button" name="button" id="button" value="提交" nclick=checkly()>
<br/>货到付款保密送货如不方面留言<br/>可直接拨打全国免费电话:<br/><span style="color:#F00; font-size:12px;"><b>400-663-2666</b></span></td>
</tr>
</form>
</table>
1.input:
<input name="textfield" type="text" value="点击添入标题" nfocus="if (value =='点击添入标题'){value =''}" nblur="if (value ==''){value='点击添入标题'}" />
2textarea:
<textarea name="textarea" cols="80" rows="17" nfocus="if(value=='正文:'){value=''}" nblur="if (value ==''){value='正文:'}" ></textarea>
收藏
举报
TAG:
input