summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2012-12-04 18:01:11 +0000
committerVincent Sanders <vince@netsurf-browser.org>2012-12-04 18:01:11 +0000
commit897acff532415ed81f9066b8b811ae744918da84 (patch)
tree093efaf239abc7d9e2411005cdaea8d14fc245d4 /test
parent878fe3e68cbda4f3d51cce7bc3b0ffcc27135367 (diff)
downloadnetsurf-897acff532415ed81f9066b8b811ae744918da84.tar.gz
netsurf-897acff532415ed81f9066b8b811ae744918da84.tar.bz2
make events work on elements
Diffstat (limited to 'test')
-rw-r--r--test/js/event-onclick.html30
-rw-r--r--test/js/index.html19
2 files changed, 47 insertions, 2 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>
diff --git a/test/js/index.html b/test/js/index.html
index 7a17c95d3..bb2918cac 100644
--- a/test/js/index.html
+++ b/test/js/index.html
@@ -5,12 +5,15 @@
</head>
<body>
<h1>JavaScript Tests</h1>
+
+
<h2>Window</h2>
<ul>
<li><a href="window.lately.html">location</a></li>
<li><a href="window-enumerate.html">enumerate</a></li>
</ul>
+
<h2>Document write</h2>
<ul>
<li><a href="inline-doc-write-simple.html">Simple document write</a></li>
@@ -22,7 +25,9 @@
<li><a href="inline-innerhtml.html">Inline script innerHtml test</a></li>
</ul>
+
<h2>DOM tests</h2>
+
<h3>Reference method tests</h3>
<ul>
<li><a href="dom-element-firstElementChild.html">firstElementChild</a></li>
@@ -31,24 +36,34 @@
<li><a href="dom-element-childElementCount.html">childElementCount</a></li>
<li><a href="doc-dom2.html">getElementById</a></li>
<li><a href="dom-getElementsByTagName.html">getElementsByTagName</a></li>
-
</ul>
+
<h3>Enumeration tests</h3>
<ul>
<li><a href="dom-node-enumerate.html">Node element interface</a></li>
<li><a href="dom-body-enumerate.html">Body element interface</a></li>
<li><a href="dom-document-enumerate.html">Document interface</a></li>
</ul>
+
<h3>Document element specific</h3>
<ul>
<li><a href="dom-doc-cookie.html">Cookie dispaly (only from server)</a></li>
<li><a href="dom-doc-location.html">location</a></li>
</ul>
+
+
+<h2>Dom events</h2>
+<ul>
+<li><a href="event-onload.html">window.onload</a></li>
+<li><a href="event-onclick.html">button.onclick</a></li>
+</ul>
+
+
<h2>Assorted</h2>
<ul>
<li><a href="assorted-log-doc-write.html">console.log and document.write</a></li>
-
<li><a href="wikipedia-lcm.html">Example from wikipedia</a></li>
</ul>
+
</body>
</html>