I use a component that generates a iframe
by accessing a remote page.
Example: Assuming that in iframe
there is a table with some TDs
with class destaque
, I want to put a red border in these "highlights".
I tried the following code, but it does not work:
$('iframe tr td.destaque').css('border-color', 'red');
How to change the style of an element in a iframe
from the parent page?
UPDATE: Trying to use contents
, as answered by @Rafalages, displays the following error:
jquery-3.1.0.min.js: 2 Uncaught SecurityError: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin " link "from accessing a frame with origin" link ". Protocols, domains, and ports must match.