HTML DOM 教程
HTML DOM - 事件
HTML DOM 允许 JavaScript 对 HTML 事件作出反应。
源代码:
点击运行 »
Mouse Over Me Click Me <!-- function clickMeEvent(obj) { if (obj.innerHTML == "Goodbye") { obj.style.display = "none"; } else if (obj.innerHTML == "Thank You") { obj.innerHTML = "Goodbye"; } else if (obj.innerHTML == "Click Me<br>Click Me Again<br>And Again") { obj.innerHTML = "Thank You"; } else if (obj.innerHTML == "Click Me<br>Click Me Again") { obj.innerHTML = obj.innerHTML + "<br>And Again"; } else { obj.innerHTML = obj.innerHTML + "<br>Click Me Again"; } } //-->
运行结果:
点击运行 »