JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/css/bootstrap.min.css">
<div id="content">

</div>

JavaScript

$(document).ready(function() {
//assume below var is template get by http request
var template = '<div class="btn-group" data-toggle="buttons">' +
        '<label class="btn btn-primary" value="0" <%- speed==0?"active":"" %>>' +
        '<input type="radio" name="options" id="option0" autocomplete="off" <%- speed==0?"checked":"" %>>Off</label>' +
        '<label class="btn btn-primary" value="1" <%- speed==1?"active":"" %>>' +
        '<input type="radio" name="options" id="option1" autocomplete="off" <%- speed==1?"checked":"" %>>Low</label>' +
        '<label class="btn btn-primary" value="2" <%- speed==2?"active":"" %>>' +
        '<input type="radio" name="options" id="option2" autocomplete="off" <%- speed==2?"checked":"" %>>Medium</label>' +
        '<label class="btn btn-primary" value="3" <%- speed==3?"active":"" %>>' +
        '<input type="radio" name="options" id="option3" autocomplete="off" <%- speed==3?"checked":"" %>>High</label>' +
      '</div>';

$('#content').html(template);
$('#option0').button('toggle');
});