Online jQuery Editor

<html> <head> <title>jQuery Example</title> <script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script> $(document).ready(function() { $("div").click(function () { var color = $(this).css("background-color"); $("#result").html("That div is <span style = 'color:" + color + ";'>" + color + "</span>."); }); }); </script> <style> div { width:60px; height:60px; margin:5px; float:left; } </style> </head> <body> <p>Click on any square:</p> <span id = "result"> </span> <div style = "background-color:blue;"></div> <div style = "background-color:gray;"></div> <div style = "background-color:#123456;"></div> <div style = "background-color:#f11;"></div> </body> </html>