运行代码 缩小
汉王
HTML代码
复制 格式化 注释 注释 清空
放大
AخA
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
<title>当前输入框高亮显示</title>
6
<style> 
7
body,form,h2,p,input{margin:0;padding:0;}
8
body{color:#4f4f4f;font:14px/1.5 \5fae\8f6f\96c5\9ed1;}
9
form{width:400px;background:#fef4eb;border:2px solid #f60;padding-bottom:10px;overflow:hidden;zoom:1;margin:10px auto;}
10
form h2{color:#fe791e;font-size:16px;background:#ffebd7;border-bottom:2px solid #f60;padding:5px 10px;}
11
form p{float:left;clear:both;width:100%;height:31px;margin-top:10px;line-height:31px;}
12
form label,form input{float:left;}
13
form label{width:100px;height:31px;text-align:right;}
14
form input{border:0;font-family:\5fae\8f6f\96c5\9ed1;background:url(//ku.shouce.ren/files/images/201601/56a3662674a7a.png) no-repeat;}
15
form .f-text,form .f-text-high{width:203px;height:31px;padding-left:5px;line-height:31px;}
CSS代码
复制 格式化 注释 注释 颜色 清空
放大
CSS代码...
x
 
1
JS代码
复制 格式化 注释 注释 清空
放大
JS代码...
xxxxxxxxxx
1
 
1
名称
当前输入框高亮显示
分类
表单按钮
描述
利用JavaScript技术实现的当前输入框高亮显示代码,在很多的网页表单中,当用户鼠标点击文本框的时候,该文本框就会显示高亮状态,提醒用户输入,本例通过JAVAScript代码实现了这样一种效果。
收藏