summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/tests/getElementsByClassName.html
diff options
context:
space:
mode:
authorxue <>2005-12-05 01:00:16 +0000
committerxue <>2005-12-05 01:00:16 +0000
commitccf76e430b7703db028966a845a966f50956f490 (patch)
tree9762b746f8b7d432dbe5e5cb8f38f90007e0e1b5 /framework/Web/Javascripts/tests/getElementsByClassName.html
parent418baf36d477bcbdd6fb4eaf4037ea6a2d93f21c (diff)
Diffstat (limited to 'framework/Web/Javascripts/tests/getElementsByClassName.html')
-rw-r--r--framework/Web/Javascripts/tests/getElementsByClassName.html28
1 files changed, 28 insertions, 0 deletions
diff --git a/framework/Web/Javascripts/tests/getElementsByClassName.html b/framework/Web/Javascripts/tests/getElementsByClassName.html
new file mode 100644
index 00000000..b764aac4
--- /dev/null
+++ b/framework/Web/Javascripts/tests/getElementsByClassName.html
@@ -0,0 +1,28 @@
+<html>
+<head>
+ <script type="text/javascript" src="../../base.js"></script>
+ <script type="text/javascript" src="../../dom.js"></script>
+ <script type="text/javascript">
+ function test() {
+ var elements = document.getElementsByClassName($('class-name').value);
+ for (var i = 0; i < elements.length; i++) elements[i] = elements[i].id;
+ alert(elements.join(', '));
+ return false;
+ }
+ </script>
+</head>
+<body>
+ <div id="a" class="foo">a: foo</div>
+ <div id="b" class="foo bar">b: foo, bar</div>
+ <div id="c" class="bar">c: bar</div>
+ <div id="d" class="bar baz">d: bar, baz</div>
+ <div id="e" class="baz">e: baz</div>
+ <div id="f" class="foo baz">f: foo, baz</div>
+
+ <fieldset>
+ <label for="class-name">Class name:</label>
+ <input id="class-name" type="text" value="foo" />
+ <button onclick="return test()">Find</button>
+ </fieldset>
+</body>
+</html>