test
Style font-family Property
Source Code
Result
<!DOCTYPE HTML> <html> <body> <p id="myP">This is a paragraph.Click vào font-family để xem kết quả</p> <select onchange="myFunction(this);" size="6" style="width:200px;background:#eee"> <option>arial</option> <option>times</option> <option>tahoma</option> <option>consolas</option> <option>cursive</option> <option>VNI-duff</option> </select> <script> function myFunction(selectTag) { var listValue = selectTag.options[selectTag.selectedIndex].text; document.getElementById("myP").style.fontFamily=listValue; } </script> </body> </html>
Update