Skip to content

Commit

Permalink
attempt to find elements inside returned collection of Tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Quickcorp committed Mar 9, 2018
1 parent 186652e commit 09ce2f4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion QCObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,18 @@
return _o;
};

Class('TagElements',Array,{
findElements:function (elementName){
var _o = New(TagElements);
for (var _k in this){
if (typeof _k ==='number' && typeof this[_k] != 'function' && this[_k].hasOwnProperty('querySelectorAll')){
_o.push(this[_k].querySelectorAll(elementName));
}
}
return _o;
}
});

/**
* Gets the element of DOM found by tag name
*
Expand All @@ -565,7 +577,7 @@
*/
var Tag = function(tagname, innerHTML) {
var o = document.querySelectorAll(tagname);
var _o = [];
var _o = New(TagElements);
var addedKeys = []
for (var _i=0;_i<o.length;_i++){
if ( typeof innerHTML != 'undefined' && o[_i].hasOwnProperty('innerHTML')) {
Expand Down

0 comments on commit 09ce2f4

Please sign in to comment.