Created
February 27, 2015 16:25
-
-
Save stevelippert/3fed3ceab675b5b43fa4 to your computer and use it in GitHub Desktop.
An example of good counting of a matching element on the page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function countFlaggedQs(){ | |
var fgC = $(".q-flag").children(".icon-flag").length, | |
fgT = ' flagged questions'; | |
fgT = (fgC === 1) ? ' flagged question' : ' flagged questions'; | |
$("#q_fg").html( fgC+' <i class="icon-flag" title="'+fgC+fgT+'"></i>' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment