jQuery addClass example

Change class name on click in jQuery

by cchana

HTML

<div class="review-button">
<a href="/"></a>
<b>Be the first to</b><a href="/"><b>write a review</b></a> <b></b>
</div>

JavaScript

var string = [];
$('.review-button b').each(function(val) {
	string.push($(this).text());
});

$('.review-button').html('<a href="/"></a>' + string.join(' '));