simple frame contents() example doesn't work

simple frame contents() example doesn't work

Hi all,
i created an example page regarding the contents() method to access a frame content but i can't get it work

HOME.HTML
<!DOCTYPE html>
<html>
<head>
<title>Myhome</title>
<script type="text/javascript" src="jquery-1.12.4.js"></script> (tried also 3.1.0)
</head>
<body>

      <iframe src="mycom.html" name="main" id="myframe"></iframe>

<script type="text/javascript">

$("#myframe").contents().find("div").css( "background-color", "#BADA55" );

</script>

</body>
</head>

</html>


MYCOM.HTML

<!DOCTYPE html>
<html>
<head>
<title></title>
</head>

<body>
<div id="foo"><H1>MYCOM FRAME!</H1></div>
</body>

</html>

No errors from console, any idea?

Thanks