title: Using jQuery attr() to set “css”
body: <p>I am reading the book "jQuery Pocket Reference", O’Reilly, 2011.</p>
  
  <p>On page 15 it says:</p>
  
  <p>'For example, calling attr("css", {backgroundColor:"gray"}) is the same as calling css({backgroundColor:"gray"}).'</p>
  
  <p>But I cannot make the attr(“css”, { }) work.  My test code: <a href="http://jsfiddle.net/4UMN3/4/" rel="noreferrer">http://jsfiddle.net/4UMN3/4/</a>    </p>
  
  <pre><code>$(function() {
  $("#btnChangeColor").click(function () {
  $("#spanText").attr("css", { backgroundColor: "gray" });
  
   });
  
  });
  </code></pre>
  
  <p>The css() method works fine, <a href="http://jsfiddle.net/4UMN3/5/" rel="noreferrer">http://jsfiddle.net/4UMN3/5/</a></p>