<form>
  <fieldset>  
    <label>
      <input type="radio" name="class" value="container--one" class="radio">
      <code>display:flow</code>
    </label>        
    <label>
      <input type="radio" name="class" value="container--two" class="radio">
      <code>display:flow-root</code>
    </label>     
    <label class="active">
      <input type="radio" name="class" value="container--three" checked="checked" class="radio">
      <code>display:flex</code>
    </label>
    <label>
      <input type="radio" name="class" value="container--four" class="radio">
      <code>display:grid</code>
    </label>
    <label>
      <input type="radio" name="class" value="container--five" class="radio">
      <code>display:table</code>
    </label>             
  </fieldset>  
</form>

<div class="container container--one" id="container">
  <p class="box-1">
    Box 1…
  </p>
  <p class="box-2">
    Box 2…
  </p>
  <p class="box-3">
    Box 3…
  </p>  
</div>
.container--one {
  display: flow;
}

.container--two {
  display: flow-root;
}

.container--three {
  display: flex;
}

.container--four {
  display: grid;
}

.container--five {
  display: table;
}


/* ETC (Formatting only): */

body {
  margin: 1.5em;
  font-family: sans-serif;
}

.container {
  border: 5px solid black;
  padding: 0.5rem;
}

.container p {
  margin: 0 0 0.5rem;
  padding: 0.5rem;
  border: 2px dotted black;
}


fieldset {
  border: #abab9d 1px solid;
  padding: 0;
  margin-bottom: 2em; 
}

label {
  display: inline-block;
  padding: 0.5em;
  cursor: pointer;
}

.active {
  background: #abab9d;
}
var radios = document.querySelectorAll('.radio');
var container = document.getElementById('container');
radios.forEach(function(i){
    i.addEventListener('click', function(el){
        var clicked = el.currentTarget;
        var active = clicked.parentElement.parentElement.querySelector('.active');
        active && active.classList.remove('active');
        clicked.parentElement.classList.add('active');     
        container.className = 'container '+clicked.value;
    });
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.