diff options
author | Ole Loots <ole@monochrom.net> | 2012-12-18 01:28:22 +0100 |
---|---|---|
committer | Ole Loots <ole@monochrom.net> | 2012-12-18 01:28:22 +0100 |
commit | 3019368c93600a335445c09178c9554074c7f656 (patch) | |
tree | 872c3bcbba0b74584cda24bee36ffe784806108f /test/js/event-onload.html | |
parent | c6a5109a95c1206ccf63d99316fa12b8c43bb7cf (diff) | |
parent | 0d803b6c0d252c3a1a9fa07e37d9a0b08ce567b8 (diff) | |
download | netsurf-3019368c93600a335445c09178c9554074c7f656.tar.gz netsurf-3019368c93600a335445c09178c9554074c7f656.tar.bz2 |
Merge branch 'master' into mono/removing-windom-dependency
Diffstat (limited to 'test/js/event-onload.html')
-rw-r--r-- | test/js/event-onload.html | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/js/event-onload.html b/test/js/event-onload.html index aede985a4..cd9e70543 100644 --- a/test/js/event-onload.html +++ b/test/js/event-onload.html @@ -6,9 +6,7 @@ function addTextNode() { -var newtext = document.createTextNode(" Some text added dynamically. "); -var para = document.getElementById("p1"); -para.appendChild(newtext); +para.appendChild(document.createTextNode(" Some text added dynamically. ")); } </script> @@ -19,10 +17,14 @@ para.appendChild(newtext); <p id="p1">First line of paragraph.<br /></p> </div><br /> -<button onclick="addTextNode();">add another textNode.</button> +<button id="button1" >add another textNode.</button> <script> +var button = document.getElementById("button1"); +var para = document.getElementById("p1"); + window.onload = addTextNode; +button.onclick = addTextNode; </script> </body> |