|
@@ -17,7 +17,12 @@ function nbInit(a,b){
|
|
|
var root=document, $s=a;
|
|
|
|
|
|
function searchElement(root, selector){
|
|
|
- var items = [root.getElementById(selector)];
|
|
|
+ if (root === document){
|
|
|
+ var items = [root.getElementById(selector)];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ items = root.querySelectorAll("#" + selector);
|
|
|
+ }
|
|
|
items = items[0] ? items : root.querySelectorAll(selector);
|
|
|
items = items.length ? items : root.getElementsByName(selector);
|
|
|
items = items.length ? items : root.getElementsByClassName(selector);
|