$("#description-link").click (e) -> e.preventDefault() $('#project-description').toggle() a = $(this).text() a = if (a == 'Show Details') then 'Hide Details' else 'Show Details' $(this).text(a)