Javascript examples for CSS Style Property:fontStyle
Test possible values for font style
<!DOCTYPE html> <html> <body> <p id="myP">This is a paragraph.</p> <select onchange="myFunction(this);" size="3"> <option>normal</option> <option>italic</option> <option>oblique</option> </select>//from w w w .j a v a 2 s .c o m <script> function myFunction(selectTag) { var listValue = selectTag.options[selectTag.selectedIndex].text; document.getElementById("myP").style.fontStyle = listValue; } </script> </body> </html>