This is a very low-level, conceptual question.
I have a content site where the users can rate comments left by other users using a dropdown form with two choices, +1 or -1.
I’d like to “transform” this into a nice-looking up/down arrow, a la reddit comments.
I understand that there’s a way to do this through CSS + javascript, but I don’t understand what that method is and how it works so I can begin looking into it. What exactly so I need to do to turn this dropdown into an up/down voting widget?
I don’t need help with the actual ranking of the comments, the algo for it or anything, I just want to understand how to replace this UI element with something more friendly.
The basic technique is to use javascript to hide the actual form element (probably via setting a style of
display:none) and then add your widget via the DOM manipulation methods. Then, set onclicks on the up/down arrows to update the the value of the hidden form element, increasing/decreasing it by one each time.