title: How can I remove programmatically-added styles in Chrome?
body: <p>I have a simple paragraph with two buttons which respectively color it and remove the color. The color removal works in Firefox, but not in Chrome (chromium-browser, to be precise). If I were to add the style through a style attribute ( <code>&lt;p id="paragraph" style="color: #f00;"&gt;</code> ) rather than programmatically ( <code>$('#paragraph').css('color', '#f00');</code> or <code>document.getElementById('paragraph').style.color="#f00";</code> ), then the color removal would work on both browsers. Unfortunately, this is impossible in my real-world situation. How else can I make this work?</p>
  
  <p>The code looks like this:</p>
  
  <p><strong>html</strong></p>
  
  <pre><code>&lt;p id="paragraph"&gt;TARGET&lt;/p&gt;
  &lt;input type="button" value="Style me" onclick="styleIt();" /&gt;
  &lt;input type="button" value="Strip styles" onclick="stripStyles();" /&gt;
  </code></pre>
  
  <p><strong>javascript</strong></p>
  
  <pre><code>function styleIt()
  {
      $('#paragraph').css('color', '#f00');
  }
  
  function stripStyles()
  {
      $('#paragraph').removeAttr("style");
  }
  </code></pre>
  
  <p><strong>jsFiddle</strong>: <a href="http://jsfiddle.net/qBtYW/10/" rel="nofollow">http://jsfiddle.net/qBtYW/10/</a></p>
  
  <p>P.S. I'm pretty sure the problem resides in the way <code>removeAttr</code> behaves in different browsers, but I could be wrong.</p>
  
  <p><strong>edit</strong> I realise I could use css('color', '') but I'm looking for something that will remove all styles, even those I didn't know were there...</p>