Javascript examples for CSS Style Property:fontStyle
Get the font style of a <p> element:
<!DOCTYPE html> <html> <body> <p id="myP" style="font-style:italic;">This is a paragraph.</p> <button type="button" onclick="myFunction()">Return font style</button> <script> function myFunction() {// w w w . j a va 2 s . c om console.log(document.getElementById("myP").style.fontStyle); } </script> </body> </html>