首页javascriptbackgroundjQuery Style - 如何更改背景颜色以提醒

jQuery Style - 如何更改背景颜色以提醒

我们想知道如何更改背景颜色以提醒。

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.11.0.js'></script>
<script type='text/javascript'>
$(window).load(function(){
    $("#b").click(function(e){
      $("body").css("background-color","yellow");
      console.log("background-color has changed successfully");
      e.preventDefault();
    });
});
</script>
</head>
<body>
  <a href="javascript:void(0);" id="b">Click</a>
</body>
</html>