Created
February 2, 2021 10:56
-
-
Save amitabhaghosh197/ed99af143845a322eba9c1434ddcc186 to your computer and use it in GitHub Desktop.
Pega iframeGetElements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ilp = ilp || {}; | |
ilp.getIframeElementsByClassName = function(item){ | |
var iframe = window.parent.document.getElementsByTagName("iframe"); | |
if(iframe.length > 0) | |
for(var j = 0; j < iframe.length; j++){ | |
var $iframe = iframe[j]; | |
var iframeDocument = $iframe.contentDocument? $iframe.contentDocument:$iframe.contentWindow.document; | |
var contentBody = iframeDocument.querySelector('.harnessBody'); | |
var elementsByClassName = contentBody.querySelectorAll(item); | |
return elementsByClassName; | |
} | |
} | |
var anycssClassinsidePegaDomIframe = ilp.getIframeElementsByClassName('.table-with-fields'); | |
console.log(anycssClassinsidePegaDomIframe); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment