Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<head>
<style> 
div {
  border: 15px solid transparent;
  padding: 15px;
  border-image: url(border.png);
  border-image-slice: 30;
  border-image-repeat: round;
  }
</style>
</head>
<body>
<h1>Change border-image-slice with JavaScript</h1>
<div id="main">
  <h1>Hello</h1>
</div>
<p>Click the "Try it" button to change the value of the borderImageSlice property.</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
  document.getElementById("main").style.borderImageSlice = "30%";
}
</script>
<p><b>Note:</b> Internet Explorer 10, and earlier versions, do not support the border-image-slice property.</p>
</body>
<!-- Mirrored from www.w3schools.com/cssref/tryit.asp?filename=trycss3_js_border-image-slice by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 05 Sep 2022 15:15:31 GMT -->
</html>