Javascript examples for jQuery Method and Property:css
Alert the background color of <p>.
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ console.log($("p").css("background-color")); });//ww w.j av a2s .com </script> </head> <body> <p style="background-color:yellow;">This is a paragraph.</p> </body> </html>