javascript - Font Previews in dropdown list? -


I'm looking at and how to preview the font (to show the text in the same font) There is not really much that they Are selecting in the dropdown list) Can someone direct me in the right direction? Thank you.

to provide an option to use only > Select element, that server / script to update to a traditional select element, styling the font And allows to apply other CSS >

html:
    

jquery:
  $ ('# fontList li'). Click (function () {var selected = $ (this) .index (); $ ('# fontelector option: selected') .removeAttr ('selected'); $ ('# fontselector option') .eq (selected) ) .attr ('selected', true); $ ('selected.') Removeclass ('selected'); $ (this) .addClass ('selected');});   

.

Note:

  1. It assumes that the sequence of li elements will be options similar to the order of elements, because The option becomes selected is selected by the index ( li ).

    Reference:



Comments