Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<head>
<style> 
.a {
  background-color: lightgreen;
}
#b {
  width: 250px;
  height: 250px;
}
.c {
  width: 100px;
  height: 100px;
  border: 1px solid black;
  padding: 2px;
  mix-blend-mode: difference;
}
#d {
  isolation: auto;
}
</style>
</head>
<body>
<h1>Change isolation with JavaScript</h1>
<p>Click the "Try it" button to change the isolation property for the div "d".</p>
<button onclick="myFunction()">Try it</button>
<div id="b" class="a">
  <div id="d">
  <div class="a c">div d</div>
  </div>
</div>
<script>
function myFunction() {
  document.getElementById("d").style.isolation = "isolate";