javascript - How to Select iFrames, Based on SRC, and Add a Class -
i'd select iframes on our site src contains go.pardot.com , add class called pardotiframe.
there multiple iframes on page , most, not contain go.pardot.com in src. i'm hoping use src because iframes not have class or id attribute.
here example of iframe code:
<iframe src="https://go.pardot.com/l/43312/2017-02-21/67lkx6" type="text/html" frameborder="0" allowtransparency="true" style="border: 0px; overflow: hidden;" scrolling="no"></iframe how using jquery? thanks!
to achieve can use atrribute contains selector find iframe url in src, add class it:
$('iframe[src*="go.pardot.com"]').addclass('pardotiframe');
Comments
Post a Comment