Skip to content

Instantly share code, notes, and snippets.

@athaeryn
Last active August 29, 2015 14:05
Show Gist options
  • Save athaeryn/01c44e29f15ee7dc2cf3 to your computer and use it in GitHub Desktop.
Save athaeryn/01c44e29f15ee7dc2cf3 to your computer and use it in GitHub Desktop.
Pluralize me, Cap'n!

HTML (mustache):

<div class="count">
   Found {{count}} Result<span class="ess">s</span>.
</div>

JS:

$(".count").toggleClass('plural', items.length !== 1)

CSS:

.ess {
  display: none;
}
.plural > .ess {
  display: inline;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment