A demonstration of possible values: - Javascript CSS Style Property

Javascript examples for CSS Style Property:fontFamily


A demonstration of possible values:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<p id="myP">This is a paragraph.</p>

<select onchange="myFunction(this);" size="13">
  <option>Arial Black</option>
  <option>Book Antiqua</option>
  <option>Courier New</option>
  <option>Lucida Console</option>
  <option>Lucida Sans Unicode</option>
  <option>Palatino Linotype</option>
  <option>Times New Roman</option>

</select>//from  ww w  . j a  va  2 s. c  om

function myFunction(selectTag) {
    var listValue = selectTag.options[selectTag.selectedIndex].text;
    document.getElementById("myP").style.fontFamily = listValue;


Related Tutorials