Im trying to build a collase expand function on my website.
I have the following that toggle ths hidden div only im trying to change the 'Expand' text to collapse, and then if clicked again, collapse > expand.
Can anybvody see what im doing wrong?
$('.coverage .expand').click(function(){
$(this).parent().parent().find('.subitems').toggle('slow', function() {
var togtit = $(this).parent().find('.expand');
if((togtit).is('Expand')){
togtit.html('Collapse')
} else {
togtit.html('Expand')
}
});
});