I need assistance with adding a class to an iframe only if the body tag has a specific class name. Here is my attempt at writing some code:
<iframe class='iframeContent' src='' width='100%' height='' frameborder='0'>
</iframe>
if ($('.iframeContent').contents().find('body').hasClass('alaska')) {
$('iframe').addClass('iframe-cont');
}
Any guidance or suggestions would be greatly appreciated, as my JavaScript skills are still developing.