/** * Created by Administrator on 2018/7/20. */ function my$(id) { return document.getElementById(id); }; ...
分类:
Web程序 时间:
2018-07-20 22:29:41
阅读次数:
136
1.直接查找元素document.getElementById#根据ID获取一个标签document.getElementsByName#根据name属性获取标签集合document.getElementsByClassName#根据class属性获取标签集合document.getElementsByTagName#根据标签名获取标签集合2.间接查找元素parentElement#父节点标签元素
分类:
Web程序 时间:
2018-07-20 11:22:33
阅读次数:
147
No1: jQuery能帮我们干这些事情: 消除浏览器差异:你不需要自己写冗长的代码来针对不同的浏览器来绑定事件,编写AJAX等代码; 简洁的操作DOM的方法:写$('#test')肯定比document.getElementById('test')来得简洁; 轻松实现动画、修改CSS等各种操作。 ...
分类:
编程语言 时间:
2018-07-19 21:25:42
阅读次数:
226
$(document).ready(function(){ //提交表单 $("#registerBtn").click(function(){ var email=document.getElementById("email"); if(email.validity.valueMissing==t... ...
分类:
Web程序 时间:
2018-07-18 14:08:14
阅读次数:
884
imgReady(data.object, function () { if(this.width < 360 || this.height < 360) { document.getElementById("myImageShow").src = "../../public/img/backgro ...
分类:
Web程序 时间:
2018-07-18 13:58:20
阅读次数:
1791
这个是coffeescript代码 document.addEventListener 'turbolinks:load', -> document.getElementById("new_message").addEventListener "keypress", (e) -> console.l ...
分类:
其他好文 时间:
2018-07-16 21:41:34
阅读次数:
137
这次来讲讲HTML 的event对象,事件对象,首先实现的是实现功能:当鼠标在areadiv中移动时,在messdiv中来显示鼠标的坐标。 首先先弄两个div,代码如下: <body> //首先获取两个div var aeradiv = document.getElementById("areadi ...
分类:
其他好文 时间:
2018-07-15 13:49:35
阅读次数:
150
var worldMapContainer = document.getElementById('serverStatus'); var resizeWorldMapContainer = function () { worldMapContainer.style.width = window.in... ...
分类:
其他好文 时间:
2018-07-13 17:33:48
阅读次数:
1314
javascript: 代码如下: document.getElementById("myId").setAttribute("href","www.xxx.com"); document.getElementById("myId").href = "www.xxx.com"; jquery: 代码 ...
分类:
编程语言 时间:
2018-07-13 16:24:13
阅读次数:
159
目录结构: // <![CDATA[ function shocon(){ document.getElementById("modol").style.display="block"; } function clocon(){ document.getElementById("modol").st ...
分类:
其他好文 时间:
2018-07-13 15:04:45
阅读次数:
188