<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
var list = window.parent.document.getElementsByTagName("HTML")[0];
list.getElementsByTagName("BODY")[0].style.background = "blue";
}
</script>
window.parent.document.getElementsByTagName("body").style.background = "red";