The best way to change the text on a webpage without refresh

I’m trying to emulate the upvote/downvote system used on the SE sites. Each of my pages have a score which users can upvote or downvote. The arrows are images with onclick links to javascript functions....