You cannot use <a> tags inside other <a> tags that are not valid for HTML. Check out this question.
You can make it clickable with jQuery, although with a hack like this:
HTML - use a div instead with a custom class and some data tags:
<div class="list-group"> <div class="list-group-item active list-group-item-linkable" data-link="http://www.google.com"> <h4 class="list-group-item-heading">List group item heading</h4> <p class="list-group-item-text">...</p> <a href="https://www.facebook.com/sharer/sharer.php?u=http" target="_blank"> Share on Facebook </a> </div> </div>
CSS is like a link:
.list-group-item-linkable:hover { color: #555; text-decoration: none; background-color: #f5f5f5; cursor: pointer; }
JS is the fun part:
$(document).ready(function() { $('.list-group-item-linkable').on('click', function() { // same window/tab: window.location.href = $(this).data('link'); // new window/tab: //window.open($(this).data('link')); }); $('.list-group-item-linkable a, .list-group-item-linkable button') .on('click', function(e) { e.stopPropagation(); }); });
I also created a JSFiddle .
Pedro moreira
source share