Javascript examples for CSS Style Property:font
Set the font of a <p> element:
<!DOCTYPE html> <html> <body> <p id="myP" style="font:italic bold 30px Georgia,serif;">This is a paragraph.</p> <button type="button" onclick="myFunction()">Return font</button> <script> function myFunction() {/*from ww w. j a va 2 s . c om*/ document.getElementById("myP").style.font = 'bold 10px'; } </script> </body> </html>