Mercurial > nebulaweb3
view default/node_modules/shoestring/src/dom/get.js @ 0:1d038bc9b3d2 default tip
Up:default
author | Liny <dev@neowd.com> |
---|---|
date | Sat, 31 May 2025 09:21:51 +0800 |
parents | |
children |
line wrap: on
line source
//>>excludeStart("exclude", pragmas.exclude); define([ "shoestring" ], function(){ //>>excludeEnd("exclude"); /** * Returns the raw DOM node at the passed index. * * @param {integer} index The index of the element to wrap and return. * @return {HTMLElement|undefined|array} * @this shoestring */ shoestring.fn.get = function( index ){ // return an array of elements if index is undefined if( index === undefined ){ var elements = []; for( var i = 0; i < this.length; i++ ){ elements.push( this[ i ] ); } return elements; } else { return this[ index ]; } }; //>>excludeStart("exclude", pragmas.exclude); }); //>>excludeEnd("exclude");