Edit This Code:
See Result »
<!DOCTYPE html> <html> <body> <p id="myP">This is a paragraph.</p> <button type="button" onclick="myFunction()">Set font weight</button> <script> function myFunction() { document.getElementById("myP").style.fontWeight = "900"; } </script> </body> </html>
Result: