summaryrefslogtreecommitdiff
path: root/itjs
diff options
context:
space:
mode:
authorThomas BrĂ¼derli2008-08-11 08:31:14 +0000
committerThomas BrĂ¼derli2008-08-11 08:31:14 +0000
commit9c2659c1c4a93a1cdf3fe058075dd70084dab22b (patch)
tree0f41c58cbd53120e0e2cd1a486a0bf99720df7c9 /itjs
parenta9ad07045a2f21ca1ec39ca5e7d636a61e4705ab (diff)
downloaditools-9c2659c1c4a93a1cdf3fe058075dd70084dab22b.tar.gz
itools-9c2659c1c4a93a1cdf3fe058075dd70084dab22b.tar.bz2
itools-9c2659c1c4a93a1cdf3fe058075dd70084dab22b.zip
Add function to create dom elements (former createElem() in lib.js)
Diffstat (limited to 'itjs')
-rw-r--r--itjs/it.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/itjs/it.js b/itjs/it.js
index 9cc03ec..f701261 100644
--- a/itjs/it.js
+++ b/itjs/it.js
@@ -157,6 +157,15 @@ function it_get_iframe_document(iframe)
return iframe.contentWindow ? iframe.contentWindow.document : iframe.contentDocument;
}
+/* Create a new dom element and append to doc */
+function it_create_element(doc, type, init)
+{
+ var e = document.createElement(type);
+ it_set(e, init);
+ doc.appendChild(e);
+ return e;
+}
+
/**
* Copy attributes from src to dst in a recursive manner.
* @param dst Destination object which gets attributes