summaryrefslogtreecommitdiff
path: root/test/js/event-onclick.html
diff options
context:
space:
mode:
Diffstat (limited to 'test/js/event-onclick.html')
-rw-r--r--test/js/event-onclick.html30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/js/event-onclick.html b/test/js/event-onclick.html
new file mode 100644
index 000000000..b2060e517
--- /dev/null
+++ b/test/js/event-onclick.html
@@ -0,0 +1,30 @@
+<html>
+<head>
+<title>alert onclick example</title>
+
+<script type="text/javascript">
+
+function causealert()
+{
+var txt = document.getElementById("p1").textContent;
+alert(txt);
+}
+
+</script>
+</head>
+
+<body>
+<div style="border: 1px solid red">
+<p id="p1">First line of paragraph.<br /></p>
+</div><br />
+
+<button id="button1" >add another textNode.</button>
+
+<script>
+var button = document.getElementById("button1");
+
+button.onclick = causealert;
+</script>
+
+</body>
+</html>