diff options
Diffstat (limited to 'test/js/event-onload.html')
-rw-r--r-- | test/js/event-onload.html | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/js/event-onload.html b/test/js/event-onload.html new file mode 100644 index 000000000..aede985a4 --- /dev/null +++ b/test/js/event-onload.html @@ -0,0 +1,29 @@ +<html> +<head> +<title>createTextNode onload example</title> + +<script type="text/javascript"> + +function addTextNode() +{ +var newtext = document.createTextNode(" Some text added dynamically. "); +var para = document.getElementById("p1"); +para.appendChild(newtext); +} + +</script> +</head> + +<body> +<div style="border: 1px solid red"> +<p id="p1">First line of paragraph.<br /></p> +</div><br /> + +<button onclick="addTextNode();">add another textNode.</button> + +<script> +window.onload = addTextNode; +</script> + +</body> +</html> |