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