2019年9月25日

手机版自适应

摘要: @media(min-width:760px) { .container { width: 750px } } 当手机屏幕大于760px时执行.container的代码 @media(min-width:760px) { .container { width: 750px } } 当手机屏幕大于76 阅读全文

posted @ 2019-09-25 09:01 大橙!! 阅读(321) 评论(0) 推荐(0) 编辑

2019年7月31日

自定义属性的添加

摘要: <ul id="uu"> <li>aa</li> <li>ss</li> <li>zz</li> <li>xx</li> </ul> <script> var list=document.getElementById("uu").getElementByTagname("li"); for(var 阅读全文

posted @ 2019-07-31 11:40 大橙!! 阅读(161) 评论(0) 推荐(0) 编辑

2019年7月26日

innerText Textcontent浏览器兼容代码

摘要: 设置标签中的文本内容,应该使用textcontent属性,谷歌,火狐支持 IE8不支持 设置标签中的文本内容,应该使用textcontent属性,谷歌,火狐,IE8都支持 如果这个属性在浏览器中都不支持,那么这个属性的类型是“undefined” 判断这个属性的类型是不是“undefined”,就知 阅读全文

posted @ 2019-07-26 15:50 大橙!! 阅读(135) 评论(0) 推荐(0) 编辑

2019年7月25日

获取间的内容

摘要: <input type="button" value=" 按钮" id="btn"/> <p>aaaacc</p> document.getElementById("btn").onclick=function(){ console.log(document.getElementsByTagName 阅读全文

posted @ 2019-07-25 14:50 大橙!! 阅读(87) 评论(0) 推荐(0) 编辑

密码长度为6-10的判断

摘要: <input type="text" value="" id="mm"/> document.getElementById("mm").onblur=function(){ if(mm.value.length>=6&&mm.value.length<=10){ this.style.backgro 阅读全文

posted @ 2019-07-25 11:29 大橙!! 阅读(253) 评论(0) 推荐(0) 编辑

模拟输入框

摘要: #txt{ color: gray; } #txt{ color: gray; } #txt{ color: gray; } <input type="text" value="请输入内容" id="txt"/> document.getElementById("txt").onfocus=func 阅读全文

posted @ 2019-07-25 10:09 大橙!! 阅读(100) 评论(0) 推荐(0) 编辑

2019年7月23日

排他功能

摘要: <body> <input type="button" value="Hi" /> <input type="button" value="Hi" /> <input type="button" value="Hi" /> <input type="button" value="Hi" /> <in 阅读全文

posted @ 2019-07-23 13:55 大橙!! 阅读(117) 评论(0) 推荐(0) 编辑

获取元素

摘要: 根据id属性的值获取元素,返回来的是一个元素对象 document.getElementById("id属性的值"); 根据标签名字获区元素,返回来的是一个伪数组,里面保存了多个DOM对象 document.getElementsByTagName("标签的名字"); 以下有的浏览器不支持 (h5 阅读全文

posted @ 2019-07-23 13:18 大橙!! 阅读(109) 评论(0) 推荐(0) 编辑

2019年7月13日

js中获取当前url路径

摘要: <script> $(function(){ // 返回 web 主机的域名,如:http://127.0.0.1:8080/testdemo/test.html?id=1&name=test var url = window.location.href; // 返回当前页面的路径和文件名,如:/t 阅读全文

posted @ 2019-07-13 11:16 大橙!! 阅读(39199) 评论(0) 推荐(7) 编辑

2019年6月26日

layui插件

摘要: https://www.layui.com 导航 图标 动画 按钮 表单 选项卡 进度条 面板 表格 徽章 时间线 阅读全文

posted @ 2019-06-26 13:16 大橙!! 阅读(164) 评论(0) 推荐(0) 编辑

导航