<div class="buttons">
  <button>stretch</button>
  <button>repeat</button>
  <button>round</button>
  <button>space</button>
  <button class="remove">remove "repeat" property</button>
</div>
<div class="bordered-box">
</div>
.bordered-box {
  border: 30px solid pink;
  height: 40vh;
  border-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/652/pink-doily-bdr.png") 30;
}



/* styling for Pen, unrelated to border-image */
body { background-color: #1D1F1F; }


div {
  width: 40vw;
  margin: 1em auto;
}
$('button:not(.remove)').on('click', function() {
  $('.bordered-box').css('border-image-repeat', $(this).text());
});

$('.remove').on('click', function() {
  $('.bordered-box').css('border-image-repeat', '');
});
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js