Maybe you want: $("#bodyCopy").css("font-family", $(this).val());
Also, you don't have a </select> before your </form>. - Richard Richard D. Worth http://rdworth.org/ On Sun, Mar 9, 2008 at 10:27 PM, timfm <[EMAIL PROTECTED]> wrote: > > Hi All, > > I'm new here and to jQuery. Trying to get started by developing a > typographic tools for visual designers learning CSS. I want to pass > the value of <option> as font-family to a div. Here's what I have so > far: > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> > <head> > <title></title> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> > <script type="text/javascript" src="/js/jquery-1.2.3.js"></script> > <script language="JavaScript" type="text/javascript"> > <!-- > > $("#fontSelect").change(function () { > switch ($(this).val()) > $("#bodyCopy").css("font-family"); > } > > // --> > </script> > </head> > > <body> > <div id="bodyCopy"> > <p>The darkness of the type as set in mass, which is not the > same as the <em>weight</em> of the face itself. The spacing of words > and letters, the leading of lines, and the incidence of capitals, not > to mention the color (i.e., darkness) of the ink and of the paper it > is printed on, all affect the color of the type.</p> > </div> > > <form> > <select id="fontSelect"> > <option value="courier new">Courier</option> > <option value="georgia">Georgia</option> > <option value="verdana">Verdana</option> > </form> > </body> > </html> > > Also, strangely, if I move the #bodyCopy" div below the form it > doesn't render >