prototype Element

来源:互联网 发布:程序员招聘广告 编辑:程序博客网 时间:2024/05/18 01:56

Prototype Element对象,各种与DOM元素的相互作用提供了一个强大的DOM方法 - 建立,更新,穿越他们,等你可以访问这些作为元素本身的方法,在元素传递给工作作为第一个参数,或扩展元素的实例上的方法:

// Using Element:Element.addClassName('target', 'highlighted'); // Using an extended element instance:$('target').addClassName('highlighted');

元素也是从头开始构建元素的实例的构造,详见新元素.

Most Element methods return the element instance, so that you can chain them easily:

$('message').addClassName('read').update('I read this message!');
More Information

For more information about extended elements, check out "How Prototype extends the DOM", which will walk you through the inner workings of Prototype's DOM extension mechanism.

原创粉丝点击