Skip to content

Instantly share code, notes, and snippets.

@athaeryn

athaeryn/pluralize.md

Last active Aug 29, 2015
Embed
What would you like to do?
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