I'm trying to figure out how to change the bodyfont with a selectfield and jQuery?

Is it possible at all?

Here is what I have so far:
Code JavaScript:
    jQuery(document).ready(function() {
    	jQuery("#mainfont").change(function() {jQuery(document.body).css("font-family",jQuery("#mainfont").getValue())});

The php:
PHP Code:
echo 'Main Font: <select name="mainfont" id="mainfont">';
$sql "SELECT * FROM ".$prefix."_cms_fonts ORDER BY id DESC";
$result mysql_query($sql);
$row mysql_fetch_array($result)){
'<option value="'.$row1['id'].'">'.$row1['font1'].'</option>';
In my db I have these 3 fileds (id, font1, font2)

The id is important for when submitting/saving the form, font1 is a short description of the font, and font2 is the fontcode (ex. "Verdana, Geneva, sans-serif").

Am I doing this all wrong, and can it be done?