Get jQuery Selector in iFrame

Gold Contributor
Gold Contributor

Issue: In iframes, its not possible to get the jQuery Selector by WebCompanion or the css selector Tool. Is there a posibility, to identify the jquery selector by dev. console (e.g. firebug)?

 

2 REPLIES 2

Get jQuery Selector in iFrame

Gold Contributor
Gold Contributor
Hello @PatrickHegnauer,

I would suggest you to identify jQuery selector using the below example function with the suitable function on yours,

var iContentBody = $(".iframe-content").contents().find("body");
var endLetterSequenceNo = iContentBody.find(".iframe-content p").text();

Hope it helps!!

Get jQuery Selector in iFrame

Tealium Employee

@PatrickHegnauer

 

The other way is to use the Chrome Debugging tools to copy the selector for an element.

Open the Chrome debugger tools, info here.

Right-click the element you want, and you will then see the option "Copy > Copy Selector".

 

iFrame.png

 

Hope that helps.

 

Adrian

 

Ask me anything Tealium related or TypeScript/JavaScript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.
Public