JSFiddle - React, Tailwind, and code Playground
by Kyle
HTML
<div id="lease_headsets_wrap">
<div id="pr09470_box">
<input type="checkbox" name="9470" id="jb9470">
<img src="http://www.headset.no/public/upload/9470_small.png" alt="Jabra Pro 9470">
<div class="pro9470_info">Jabra Pro 9470 Mono</div>
</div>
<div id="pr09465_box">
<input type="checkbox" name="9465">
<img src="http://www.headset.no/public/upload/9465_small.png" alt="Jabra Pro 9465 Duo">
<div class="pro9465_info">Jabra Pro 9465 Duo</div>
</div>
<div style="clear: both;">
<div id="type_wrap">
<textarea name="indicated">Skriv valg av headset her</textarea>
</div>
</div>
CSS
#lease_headsets_wrap
{
width: 575px;
height: 300px;
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
-webkit-border-radius: 5px;
}
#lease_headsets_wrap input
{
display: block;
}
#lease_headsets_wrap img
{
margin: 5px;
}
#pr09470_box
{
text-align: center;
border: 1px dashed #f00;
width: 45%;
float: left;
margin: 0 20px;
}
.pro9470_info,
.pro9465_info
{
background-color: #eee;
text-align: center;
}
#pr09465_box
{
text-align: center;
border: 1px dashed #f00;
width: 45%;
float: left;
margin: 0;
}
#type_wrap
{
margin: 5px 20px;
padding: 10px;
border: 1px dashed #0f0;
width: 90%;
height: 100px;
}
#type_wrap textarea
{
width: 95%;
height: 70%;
margin: 0 auto;
padding: 5px;
border: 1px dashed #ddd;
border-radius: 5px;
-webkit-border-radius: 5px;
}
#type_wrap textarea:focus
{
outline-color: #97CAE1;
}
.highlight
{
background-color: #e5f7c7 !important;
}
JavaScript
$(function() {
//checkbox
$("input[type=checkbox]").change(function(){
$(this).parent().toggleClass('highlight', this.checked);
});
//textarea
$("textarea").focus(function(){
if ($(this).contains('Skriv valg av headset her')){
$(this).replaceWith('');
});
});