html div 自动聚焦,让DIV也能够获取焦点
.test1{width:400px;min-height:120px;max-height:300px;border:1px solid #000;background:#eee;overflow: hidden;}
.test2{width:400px;min-height:120px;max-height:300px;border:1px solid #000;background:#eee;margin-top:80px;}
.test3{margin-top:40px;background:#eee;}
var test1 = document.querySelector(".test1");
test1.onfocus = function(){
test1.style.background = "#f00";
}
test1.onblur = function(){
test1.style.background = "#333";
}
var test2 = document.querySelector(".test2");
test2.onfocus = function(){
test2.style.background = "#f00";
}
test2.onblur = function(){
test2.style.background = "#333";
}
var test3 = document.querySelector(".test3");
test3.onfocus = function(){
test3.style.background = "#f00";
}
test3.onblur = function(){
test3.style.background = "#333";
}
contenteditable还有一个有意思的效果,在网页中按F12打开控制台,在控制台输入contenteditable="true"
结果返回true就可以直接编辑当前网页的内容。
html div 自动聚焦,让DIV也能够获取焦点相关推荐
- 设置div中的div居中显示
设置div中的div居中显示 方法一. <div class='big'><div class='small'>box1</div></div>styl ...
- html文章整体居中,div居中与div内容居中
div css构造时,常见到div 居中与div内容居中,即div自身水平居中与div内的形式居中结构. 而模式居中又分为垂直居中与程度居中,这里CSS5将一一让各人把握这几个居中构造本事. 对付di ...
- 一个不错的CSS DIV布局,DIV高度自适应
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W ...
- js如何往div里写div
原有html代码: ... <div id="div_1"> </div> ... 我现在想在这个div里写 <div id="div_2& ...
- 子div在父div中置底
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 鼠标移动到div上,div中的img放大
<!DOCTYPE html> <html><head> <meta charset="UTF-8" /> <title> ...
- jquery点击非div区域隐藏div
点击非div区域隐藏div,如图,点击圆的头像(.person-msg)弹出白色底框(.person-centre).点击圆头像以外的区域隐藏白色底框 html代码 <div class=&qu ...
- 轻松学DIV教程(div+css布局)
我爱棒棒糖! 你正在学习CSS布局吗?是不是还不能完全掌握纯CSS布局?通常有两种情况阻碍你的学习: 第一种可能是你还没有理解CSS处理页面的原理.在你考虑你的页面整体表现效果前,你应当先考虑内容的语 ...
- React 点击按钮显示div与隐藏div
<!DOCTYPE html> <html><head><meta charset="UTF-8" /><title>R ...
最新文章
- 《用Python进行自然语言处理》第 11 章 语言数据管理
- Netty笔记(一)第一个程序
- 大湾区|Serverless 线下活动两连发
- explicit_defaults_for_timestamp参数的专题报告
- POJ 1741tree-点分治入门
- 微信开发者平台如何编写代码_编写超级清晰易读的代码的初级开发者指南
- [20171218]varchar2(4000)如何保存.txt
- r语言worldclim数据_arcgis中如何提取气候数据
- 7人表决器的实现之路
- 超立方体及其可视化(Processing)
- ElasticSearch基础学习
- Web学习(二)CSS
- 协作图(Collaboration diagram)——UML之图七
- Django DRF 两种接口安全机制及其配置
- 众里资讯——黑客用改造版的Excel XLL档散步窃密软件
- 亚马逊与甲骨文互撕,透过迷雾看透数据库的江湖恩怨和大势
- 灰狼优化算法GWO优化SVM支持向量机惩罚参数c和核函数参数g,有例子
- 计算机网络方面国际三大顶尖会议 - MOBICOM - SIGCOMM - INFOCOM
- English Learning - L2-13 英音地道语音语调 弱读技巧 2023.04.6 周四
- 前端小技巧|关掉某视频解析网站上的广告
热门文章
- 工作流表单自定义功能的误区
- 关于B.M.W的最原始的说明
- Spring JdbcTemplate查询实例
- 数据库系统优化--业务逻辑设计优化
- php+mysql分库分表的哈希(hash)算法
- windows c语言 lapack安装,Windows Scipy安装:找不到Lapack/Blas资源
- 在Linux中某些程序无法运行,为何linux下的程序不能在windows下运行,不是“废话”那么简单...
- php 本地mysql 代码_基于本地数据库的 IP 地址查询 PHP 源码
- pacman 查询_linux pacman常用命令
- python邮件添加附件_如何向电子邮件python添加多个附件