Get jQuery Selector in iFrame

Silver Contributor
Silver 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)?



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



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".




Hope that helps.




Ask me anything Tealium related or Javascript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.