summaryrefslogtreecommitdiffstats
path: root/kjsembed/tests/test_dom.js
diff options
context:
space:
mode:
Diffstat (limited to 'kjsembed/tests/test_dom.js')
-rw-r--r--kjsembed/tests/test_dom.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/kjsembed/tests/test_dom.js b/kjsembed/tests/test_dom.js
new file mode 100644
index 00000000..97188438
--- /dev/null
+++ b/kjsembed/tests/test_dom.js
@@ -0,0 +1,22 @@
+//
+// Tests the DOM methods
+//
+
+var box = console.getElementById('HBox');
+var btn = box.child('RunButton');
+
+print('Button: ');
+println(btn);
+
+println( 'Property: enabled' );
+print( 'hasAttribute: ' );
+println( btn.hasAttribute('enabled') );
+print( 'getAttribute: ' );
+println( btn.getAttribute('enabled') );
+print( 'setAttribute: ' );
+println( btn.setAttribute('enabled', false) );
+print( 'getAttribute: ' );
+println( btn.getAttribute('enabled') );
+
+println();
+println( 'Now the console will be displayed with button disabled' );