Skip to content

javascript

June 3, 2008

From pro javascript:

We cant manipulate DOM until the document is fully loaded.

MyClass.prototype.newFunc= function() { alert(‘newFunction’); return ‘newFunc’; };

DOM

getElementByTagName, getElementById

li.style.border=’1px solid red’;

li.onmouseover=function(){ li.style.backgroundcolor=’blue’;};

remove node

myNode.parent.removeChild(myNode);

add Node

myNode.parent.addChild(newNode);

Array

var items = new Array(‘one’, ‘two’, ‘three’);

or items=[‘one’,’two’,’three’]; (???) items.push(‘four’);

Advertisements

Comments are closed.

%d bloggers like this: