<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<div class="panel panel-success">
<div class="panel-heading">
<h5 class="panel-title">Scenario</h5>
</div>
<div class="panel-body">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<div class="scenario" style="margin-top:-15px;">
<div class="row">
<div class="col-sm-5">
<div class="scenario-warning">
<input type="radio" name="radio" id="radio1" />
<label for="radio1">Yes</label>
</div>
</div>
<div class="col-sm-5">
<div class="scenario-primary">
<input type="radio" name="radio" id="radio2" />
<label for="radio2">No</label>
</div>
</div>
</div>
<div class="row" style="margin-bottom:15px;">
<div class="col-sm-5">
<div class="scenario-success">
<input type="radio" name="radio" id="radio3" />
<label for="radio3">Only on Fridays</label>
</div>
</div>
<div class="col-sm-5">
<div class="scenario-danger">
<input type="radio" name="radio" id="radio4" />
<label for="radio4">Never</label>
</div>
</div>
</div>
</div>
<br>
<button id="submitbtn" class="btn btn-success btn-sm">submit answer</button>
</div><!-- /panel-body -->
</div><!-- /panel -->
<div class="alert alert-info hidden" id="answerdiv">
<h5>Correct!</h5>
<p>Yes - if they decide to not purchase your listing you can work with them and show them other listings. Talk with your managing broker about what the best practice would be in this situation.
</div>
</div>
.scenario div {
overflow:hidden;
}
.scenario label {
width: 100%;
border-radius: 3px;
border: 1px solid #D1D3D4;
font-weight: 400;
}
.scenario input[type="radio"]:empty,
.scenario input[type="checkbox"]:empty {
display: none;
}
.scenario input[type="radio"]:empty ~ label,
.scenario input[type="checkbox"]:empty ~ label {
position: relative;
line-height: 2.5em;
text-indent: 3.25em;
margin-top: 2em;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.scenario input[type="radio"]:empty ~ label:before,
.scenario input[type="checkbox"]:empty ~ label:before {
position: absolute;
display: block;
top: 0;
bottom: 0;
left: 0;
content: '';
width: 2.75em;
background: #D1D3D4;
border-radius: 3px 0 0 3px;
}
.scenario input[type="radio"]:hover:not(:checked) ~ label,
.scenario input[type="checkbox"]:hover:not(:checked) ~ label {
color: #888;
}
.scenario input[type="radio"]:hover:not(:checked) ~ label:before,
.scenario input[type="checkbox"]:hover:not(:checked) ~ label:before {
content: '\2714';
text-indent: .9em;
color: #C2C2C2;
}
.scenario input[type="radio"]:checked ~ label,
.scenarioinput[type="checkbox"]:checked ~ label {
color: #777;
}
.scenario input[type="radio"]:checked ~ label:before,
.scenario input[type="checkbox"]:checked ~ label:before {
content: '\2714';
text-indent: .9em;
color: #333;
background-color: #ccc;
}
.scenario input[type="radio"]:focus ~ label:before,
.scenarioinput[type="checkbox"]:focus ~ label:before {
box-shadow: 0 0 0 3px #999;
}
.scenario-default input[type="radio"]:checked ~ label:before,
.scenario-default input[type="checkbox"]:checked ~ label:before {
color: #333;
background-color: #ccc;
}
.scenario-primary input[type="radio"]:checked ~ label:before,
.scenario-primary input[type="checkbox"]:checked ~ label:before {
color: #fff;
background-color: #337ab7;
}
.scenario-success input[type="radio"]:checked ~ label:before,
.scenario-success input[type="checkbox"]:checked ~ label:before {
color: #fff;
background-color: #5cb85c;
}
.funkyradio-danger input[type="radio"]:checked ~ label:before,
.funkyradio-danger input[type="checkbox"]:checked ~ label:before {
color: #fff;
background-color: #d9534f;
}
.scenario-warning input[type="radio"]:checked ~ label:before,
.scenario-warning input[type="checkbox"]:checked ~ label:before {
color: #fff;
background-color: #f0ad4e;
}
.scenario-info input[type="radio"]:checked ~ label:before,
.scenario-info input[type="checkbox"]:checked ~ label:before {
color: #fff;
background-color: #5bc0de;
}
$(document).ready(function(){
$("#submitbtn").click(function(){
var check = $("input:checked");
if(check.is("#radio1")) {
$("#answerdiv").removeClass("hidden");
}
else if(check.not("#radio1")) {
alert("Incorrect. Please try again.");
}
});
});