JS.findElementById()使用介绍
代码如下:
his.findElementById = function (identifier, frame) { if (!frame) { frame = window; } var element = frame.document.getElementById(identifier); if (element && element.getAttribute('id') === identifier) { return element; } // else if (browserVersion.isIE || browserVersion.isOpera) { // // SEL-484 // var xpath = '/descendant::*[@id=' + identifier.quoteForXPath() + ']'; // return this // .findElementByXPath(xpath); // } else { // MOD 2011-12-9 有的新窗口中frame与老窗口相同。一般是先操作新窗口。从后向前找 if (frame.frames && frame.frames.length > 0) { for (var i = frame.frames.length - 1; i >= 0; i--) { element = this.findElementById(identifier, frame.frames[i]); //frames[i].document.getElementById(identifier); if (element && element.getAttribute("id") === identifier) { return element; } } } } return null; };
相关推荐
wikiwater 2020-10-27
IdeaElements 2020-08-19
Sophiego 2020-08-16
Kakoola 2020-08-01
Kakoola 2020-07-29
ELEMENTS爱乐冬雨 2020-07-18
ELEMENTS爱乐小超 2020-07-04
ELEMENTS爱乐小超 2020-07-04
Kakoola 2020-06-28
Feastaw 2020-06-18
Wmeng0 2020-06-14
ELEMENTS爱乐冬雨 2020-06-14
云之高水之远 2020-06-14
哈喽elements 2020-06-14
Feastaw 2020-06-11