change font on dropdown

change the font of an element from the font selected in the form select element.

by Oliver Kelso

HTML

<form method='post'>
    <select name="font_styles" id="fChange">
        <option>Choose Font</option>
        <option value="tahoma">Tahoma</option>
        <option value="helvetica">Helvetica</option>
        <option value="monospace">Monospace</option>
        <option value="impact">Impact</option>
    </select>
</form>
 <h1 id="uName">username</h1>

CSS

#uName{
    font-size:40px;
}

JavaScript

$("select#fChange").change(function(){
    var font = $(this ).val();
    $("#uName").attr("style", "font-family: " + font);
});