Fork me on GitHub

UpvoteJS - a voting widget

UpvoteJS is a JavaScript package to create a voting widget like the one used on Stack Exchange sites.

Examples

stackoverflow.com

unix.stackexchange.com

superuser.com

serverfault.com

Markup (read-only examples)

Basic

5
<div id="basic" class="upvotejs">
    <a class="upvote"></a>
    <span class="count">5</span>
    <a class="downvote"></a>
    <a class="star"></a>
</div>

Upvoted

6
<div id="upvoted" class="upvotejs">
    <a class="upvote upvote-on"></a>
    <span class="count">6</span>
    <a class="downvote"></a>
    <a class="star"></a>
</div>

Downvoted

4
<div id="downvoted" class="upvotejs">
    <a class="upvote"></a>
    <span class="count">4</span>
    <a class="downvote downvote-on"></a>
    <a class="star"></a>
</div>

Upvoted and starred

6
<div id="upvoted-and-starred" class="upvotejs">
    <a class="upvote upvote-on"></a>
    <span class="count">6</span>
    <a class="downvote"></a>
    <a class="star star-on"></a>
</div>

unix.stackexchange.com style

4
<div id="unix" class="upvotejs upvotejs-unix">
    <a class="upvote"></a>
    <span class="count">4</span>
    <a class="downvote downvote-on"></a>
    <a class="star"></a>
</div>

serverfault.com style

6
<div id="serverfault" class="upvotejs upvotejs-serverfault">
    <a class="upvote upvote-on"></a>
    <span class="count">6</span>
    <a class="downvote"></a>
    <a class="star star-on"></a>
</div>

Links