Something a bit different here. Don't know how to go about it.
If the size has not been selected, the button will hover "NEED SIZE". If user clicks it will open dropdown which in bootstrap is class open
. Once user has selected size, destory/remove the hover.
Any idea how this is achieved?
CSS Hover:
.cart-btn:hover span {display:none}
.cart-btn:hover:before {content:"NEED SIZE"}
Button:
<button id="cart-btn" type="button" class="btn btn-success btn-lg cart-btn">
<span>ADD TO CART</span>
</button>
HTML form:
<div class="btn-group cart-dd" id="cart-dd">
<a class="btn btn-default dropdown-toggle cart-dd" data-toggle="dropdown" href="#">
Select Size <span class="caret"></span></a>
<ul class="dropdown-menu cart-dd">
<li>
<input type="radio" class="blue" value="one" name="size" id="one">
<label class="size-label" for="1">One</label>
</li>
<li>
<input type="radio" class="red" value="one" name="size" id="two">
<label for="two">Two</label>
</li>
</ul>
</div>
jQuery:
$(".dropdown-menu li label").click(function(){
var selected = $(this).text();
$(this).parents('#cart-dd').find('.dropdown-toggle').html(selected);
});