The
<object>
element creates a separate document, in a similar way to an
<iframe>
.
Since it's from the same domain, you can get access to that document using
jQuery's contents
method[
^]. But a jQuery selector run against the top-level document will not be able to select elements in the nested document.
jQuery("object stop")
will return zero matches, since the
stop
is not part of the current document. But
jQuery("object").contents().find("stop")
should work.
jQuery('.test').on('click', function () {
jQuery('object').contents().find('stop').each(function () {
var color = jQuery(this).css('stop-color');
if (color === 'rgb(77, 77, 77)') {
jQuery(this).css('stop-color', '#ff0000');
}
});
});