Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery Add CSS Property</title> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script> $(document).ready(function(){ $("h1").css("color", "red"); $("p").css({ "background-color": "yellowgreen", "font-weight": "bold" }); }); </script> </head> <body> <h1>This is a heading</h1> <p>This is a paragraph.</p> </body> </html>