I'm making a blog type webpage, with a div that has a 'like' and 'dislike' button, and a rating above which is a mysql query of likes/(likes+dislikes). When a user clicks like or dislike, I want to add their vote to the db, and dynamically change the rating value without reloading the page. Here's a little snippet of the html, I have barely worked with javascript, so any help would be great.
<div class="narrow_right_container">
<?php
$popularity = get_popularity($row);
?>
<div class="yellow_bg">Rating: <?php echo $popularity . "%"; ?></div>
<div style="margin-left:2px;">
<div class="dislike">
<a href="#"><img src="ui_images/dislike.png"/></a>
<span>Dislike</span>
</div>
<div class="like">
<a href="#"><img src="ui_images/like.png" /></a>
<span>Like</span>
</div>
</div>
</div>