This is because to create valid markup, the attribute values need to be wrapped, be it in single quotes or double quotes. Fortunately, the use of which type doesn't matter, as long as you're consistent within a given string (though at least try to use the same approach in all your code).
As an example, this line:
$("<li><a href='#bookmark" + cAnchorCount++ + "'>" + $(this).text() + "</a></li>")
Would generate this markup:
<li><a href='#bookmarkSomeAnchorCount'>Some Text</a></li>
And the same would be true if you reverse the use of quotes. This new line:
$('<li><a href="#bookmark' + cAnchorCount++ + '">' + $(this).text() + '</a></li>')
Would generate this markup:
<li><a href="#bookmarkSomeAnchorCount">Some Text</a></li>
In essence, one quote type is being used to delineate string literals while the other is a character you want to include within the resulting string because the resulting markup requires it to be valid.