2010年4月21日
摘要:
1.通过ele.setCapture();设置鼠标事件的抓取。2,应用可以通过单、双击文字来获取时间。代码如下:<html> <head><title>鼠标事件的抓取</title><script language="JavaScript">// 鼠标事件的抓取function mouseCapture(){ ele.setCapture...
阅读全文
posted @ 2010-04-21 16:41
wtq
阅读(393)
推荐(0)
摘要:
气泡事件系统属于一种阶层架构的事件处理系统,即触发子标签也会触发父标签。<html><head> <title>气泡事件系统</title></head><body onclick="alert('<body>');"><h2>气泡事件系统</h2><hr><form na...
阅读全文
posted @ 2010-04-21 16:31
wtq
阅读(256)
推荐(0)
摘要:
1,应用,动态设置事件是否激发代码:<html> <head><title>取消事件处理</title><script language="JavaScript">// 事件处理程序function showAlert(){ alert("测试取消事件处理!");}// 取消事件function cancelEvent(){ docume...
阅读全文
posted @ 2010-04-21 16:24
wtq
阅读(272)
推荐(0)
摘要:
1,新特点,单击文档,自动弹出一个对话框,代码如下:<html><head> <title>Window和Document对象的事件</title><script language="JavaScript">// 事件处理程序function showAlert(){ alert("测试Window和Document对象的事件!");}/...
阅读全文
posted @ 2010-04-21 16:20
wtq
阅读(400)
推荐(0)
摘要:
1,要点:先获得标签对象,再通过sytle对其属性进行设置2,主要创新:改变页面的背景颜色:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www....
阅读全文
posted @ 2010-04-21 16:03
wtq
阅读(470)
推荐(0)
摘要:
<html><head> <title>访问HTML元素的位置和尺寸</title><script language="JavaScript">function showPosition(){ alert("left:" + myP.offsetLeft + " top:" +myP.offsetTop);}function showSi...
阅读全文
posted @ 2010-04-21 15:15
wtq
阅读(4421)
推荐(0)
摘要:
<html> <head><title>访问HTML标签的属性</title><script language="JavaScript">function setAlign(strAlign){ myP.align = strAlign;}function getAlign(){ alert(document.all.tags("P")....
阅读全文
posted @ 2010-04-21 15:10
wtq
阅读(263)
推荐(0)
摘要:
<html> <head><title>访问HTML元素的内容</title><script language="JavaScript">function changeText(){ myH2.innerText = "更改文字内容";}function changeHTML(){ myH2.innerHTML = "<marque...
阅读全文
posted @ 2010-04-21 15:06
wtq
阅读(313)
推荐(0)
摘要:
<html> <head><title>访问父元素和子元素</title><script language="JavaScript">function showParentTag(){ alert(myP.parentElement.tagName); }function showChildsTag(){ var strTags = ""...
阅读全文
posted @ 2010-04-21 14:58
wtq
阅读(2400)
推荐(0)