1 var Class = {
2     create: function() {
3         return function() { 
4             this.initialize.apply(this, arguments); }
5     }
6 };        

对象扩展

1 var Extend = function(destination, source) {
2     for (var property in source) {
3         destination[property] = source[property];
4     }
5 };

获取DOM元素属性

 1 var Attr = function (element, key, value) {
 2     if(arguments.length == 2){
 3         if(element.getAttribute){
 4             return element.getAttribute(key) || element[key] || undefined;
 5         }
 6     }
 7     else if(arguments.length == 3){
 8         element.setAttribute(key,value);
 9     }
10 };

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-03-10
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-23
  • 2021-06-13
  • 2021-10-05
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案