<html>
<head>
<style>
#myDIV {
position: absolute;
width: 100px;
height: 100px;
background-color: coral;
}
</style>
</head>
<body>
<h1>Change clip with JavaScript</h1>
<p>Click the "Try it" button to clip the DIV element:</p>
<button onclick="myFunction()">Try it</button>
<div id="myDIV">
<h1>myDIV</h1>
</div>
<script>
function myFunction() {
document.getElementById("myDIV").style.clip = "rect(0px,50px,50px,0px)";
}
</script>
</body>
</html>